From 70ade9562fe5215e4e72f6e736ccd3f269bd813e Mon Sep 17 00:00:00 2001 From: tdakkota Date: Fri, 8 Dec 2023 15:13:33 +0300 Subject: [PATCH] chore: update code due to cgenerator changes --- integration/prome2e/oas_test.go | 2 +- internal/promhandler/promql.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration/prome2e/oas_test.go b/integration/prome2e/oas_test.go index 51842a78..e5ad7c7e 100644 --- a/integration/prome2e/oas_test.go +++ b/integration/prome2e/oas_test.go @@ -114,7 +114,7 @@ func TestPrometheusOAS(t *testing.T) { vr := v.Result[0] assert.Equal(t, "go_info", vr.Metric["__name__"], "metric name") assert.Greater(t, vr.Value.T, 0.0, "value") - assert.Equal(t, vr.Value.HistogramOrValue.Float64, 1.0) + assert.Equal(t, vr.Value.HistogramOrValue.StringFloat64, 1.0) } var ( diff --git a/internal/promhandler/promql.go b/internal/promhandler/promql.go index 8ac62074..58bdd242 100644 --- a/internal/promhandler/promql.go +++ b/internal/promhandler/promql.go @@ -78,7 +78,7 @@ func mapSample(s promql.Sample) promapi.Sample { if h := s.H; h != nil { val.SetHistogram(mapHistogram(h)) } else { - val.SetFloat64(s.F) + val.SetStringFloat64(s.F) } return promapi.Sample{ T: apiTimestamp(s.T),