retrieval: handle not found error correctly

pull/2643/head
Fabian Reinartz 8 years ago
parent 598e2f01c0
commit 035976b275

@ -20,6 +20,8 @@ import (
_ "net/http/pprof" // Comment this line to disable pprof endpoint. _ "net/http/pprof" // Comment this line to disable pprof endpoint.
"os" "os"
"os/signal" "os/signal"
"runtime"
"runtime/trace"
"syscall" "syscall"
"time" "time"
@ -56,10 +58,24 @@ var (
func init() { func init() {
prometheus.MustRegister(version.NewCollector("prometheus")) 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 { 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 { if err := parse(os.Args[1:]); err != nil {
log.Error(err) log.Error(err)
return 2 return 2

@ -14,7 +14,6 @@
package promql package promql
import ( import (
"fmt"
"math" "math"
"regexp" "regexp"
"sort" "sort"
@ -725,8 +724,6 @@ func funcHistogramQuantile(ev *evaluator, args Expressions) Value {
q := ev.evalFloat(args[0]) q := ev.evalFloat(args[0])
inVec := ev.evalVector(args[1]) inVec := ev.evalVector(args[1])
fmt.Println("invec", inVec)
outVec := Vector{} outVec := Vector{}
signatureToMetricWithBuckets := map[uint64]*metricWithBuckets{} signatureToMetricWithBuckets := map[uint64]*metricWithBuckets{}
for _, el := range inVec { 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. // The only timeout we care about is the configured scrape timeout.
// It is applied on request. So we leave out any timings here. // It is applied on request. So we leave out any timings here.
var rt http.RoundTripper = &http.Transport{ var rt http.RoundTripper = &http.Transport{
Proxy: http.ProxyURL(cfg.ProxyURL.URL), Proxy: http.ProxyURL(cfg.ProxyURL.URL),
DisableKeepAlives: true, MaxIdleConns: 10000,
TLSClientConfig: tlsConfig, TLSClientConfig: tlsConfig,
} }
// If a bearer token is provided, create a round tripper that will set the // If a bearer token is provided, create a round tripper that will set the

Loading…
Cancel
Save