retrieval: handle not found error correctly
This commit is contained in:
parent
598e2f01c0
commit
035976b275
|
@ -20,6 +20,8 @@ import (
|
|||
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime"
|
||||
"runtime/trace"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
|
@ -56,10 +58,24 @@ var (
|
|||
|
||||
func init() {
|
||||
prometheus.MustRegister(version.NewCollector("prometheus"))
|
||||
runtime.SetMutexProfileFraction(20)
|
||||
runtime.SetBlockProfileRate(20)
|
||||
}
|
||||
|
||||
// Main manages the startup and shutdown lifecycle of the entire Prometheus server.
|
||||
// Main manages the stup and shutdown lifecycle of the entire Prometheus server.
|
||||
func Main() int {
|
||||
go func() {
|
||||
f, err := os.Create("trace")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := trace.Start(f); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
time.Sleep(30 * time.Second)
|
||||
trace.Stop()
|
||||
f.Close()
|
||||
}()
|
||||
if err := parse(os.Args[1:]); err != nil {
|
||||
log.Error(err)
|
||||
return 2
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
package promql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"regexp"
|
||||
"sort"
|
||||
|
@ -725,8 +724,6 @@ func funcHistogramQuantile(ev *evaluator, args Expressions) Value {
|
|||
q := ev.evalFloat(args[0])
|
||||
inVec := ev.evalVector(args[1])
|
||||
|
||||
fmt.Println("invec", inVec)
|
||||
|
||||
outVec := Vector{}
|
||||
signatureToMetricWithBuckets := map[uint64]*metricWithBuckets{}
|
||||
for _, el := range inVec {
|
||||
|
|
|
@ -78,9 +78,9 @@ func NewHTTPClient(cfg config.HTTPClientConfig) (*http.Client, error) {
|
|||
// The only timeout we care about is the configured scrape timeout.
|
||||
// It is applied on request. So we leave out any timings here.
|
||||
var rt http.RoundTripper = &http.Transport{
|
||||
Proxy: http.ProxyURL(cfg.ProxyURL.URL),
|
||||
DisableKeepAlives: true,
|
||||
TLSClientConfig: tlsConfig,
|
||||
Proxy: http.ProxyURL(cfg.ProxyURL.URL),
|
||||
MaxIdleConns: 10000,
|
||||
TLSClientConfig: tlsConfig,
|
||||
}
|
||||
|
||||
// If a bearer token is provided, create a round tripper that will set the
|
||||
|
|
Loading…
Reference in New Issue