mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 06:17:27 -08:00
Fix unkeyed field errors.
This commit is contained in:
parent
36ec8ba460
commit
171f50706a
|
@ -1084,7 +1084,7 @@ func TestNaNExpression(t *testing.T) {
|
|||
|
||||
if !math.IsNaN(float64(nl.Val)) {
|
||||
t.Errorf("error on input 'NaN'")
|
||||
t.Fatalf("expected 'NaN' in number literal but got %d", nl.Val)
|
||||
t.Fatalf("expected 'NaN' in number literal but got %v", nl.Val)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ func TestRuleEval(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
name: "nolabels",
|
||||
expr: &promql.NumberLiteral{1},
|
||||
expr: &promql.NumberLiteral{Val: 1},
|
||||
labels: model.LabelSet{},
|
||||
result: model.Vector{&model.Sample{
|
||||
Value: 1,
|
||||
|
@ -47,7 +47,7 @@ func TestRuleEval(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "labels",
|
||||
expr: &promql.NumberLiteral{1},
|
||||
expr: &promql.NumberLiteral{Val: 1},
|
||||
labels: model.LabelSet{"foo": "bar"},
|
||||
result: model.Vector{&model.Sample{
|
||||
Value: 1,
|
||||
|
|
|
@ -88,7 +88,9 @@ func (api *API) Register(r *route.Router) {
|
|||
respond(w, data)
|
||||
}
|
||||
})
|
||||
return prometheus.InstrumentHandler(name, httputil.CompressionHandler{hf})
|
||||
return prometheus.InstrumentHandler(name, httputil.CompressionHandler{
|
||||
Handler: hf,
|
||||
})
|
||||
}
|
||||
|
||||
r.Get("/query", instr("query", api.query))
|
||||
|
|
|
@ -173,7 +173,7 @@ func New(st local.Storage, qe *promql.Engine, rm *rules.Manager, status *Prometh
|
|||
router.Get(o.MetricsPath, prometheus.Handler().ServeHTTP)
|
||||
|
||||
router.Get("/federate", instrh("federate", httputil.CompressionHandler{
|
||||
http.HandlerFunc(h.federation),
|
||||
Handler: http.HandlerFunc(h.federation),
|
||||
}))
|
||||
|
||||
h.apiLegacy.Register(router.WithPrefix("/api"))
|
||||
|
|
Loading…
Reference in a new issue