diff --git a/pkg/tsdb/prometheus/buffered/framing_test.go b/pkg/tsdb/prometheus/buffered/framing_test.go index 6a1de191150..3f7927c6945 100644 --- a/pkg/tsdb/prometheus/buffered/framing_test.go +++ b/pkg/tsdb/prometheus/buffered/framing_test.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/json" + "fmt" "io" "net/http" "os" @@ -34,6 +35,7 @@ func TestMatrixResponses(t *testing.T) { {name: "parse a simple matrix response with value missing steps", filepath: "range_missing"}, {name: "parse a response with Infinity", filepath: "range_infinity"}, {name: "parse a response with NaN", filepath: "range_nan"}, + {name: "parse a response with legendFormat __auto", filepath: "range_auto"}, } for _, test := range tt { @@ -94,39 +96,28 @@ func makeMockedApi(responseBytes []byte) (apiv1.API, error) { // struct here, because it has `time.time` and `time.duration` fields that // cannot be unmarshalled from JSON automatically. type storedPrometheusQuery struct { - RefId string - RangeQuery bool - Start int64 - End int64 - Step int64 - Expr string + RefId string + RangeQuery bool + Start int64 + End int64 + Step int64 + Expr string + LegendFormat string } -func loadStoredPrometheusQuery(fileName string) (PrometheusQuery, error) { +func loadStoredPrometheusQuery(fileName string) (storedPrometheusQuery, error) { //nolint:gosec bytes, err := os.ReadFile(fileName) if err != nil { - return PrometheusQuery{}, err + return storedPrometheusQuery{}, err } - var query storedPrometheusQuery - - err = json.Unmarshal(bytes, &query) - if err != nil { - return PrometheusQuery{}, err - } - - return PrometheusQuery{ - RefId: query.RefId, - RangeQuery: query.RangeQuery, - Start: time.Unix(query.Start, 0), - End: time.Unix(query.End, 0), - Step: time.Second * time.Duration(query.Step), - Expr: query.Expr, - }, nil + var sq storedPrometheusQuery + err = json.Unmarshal(bytes, &sq) + return sq, err } -func runQuery(response []byte, query PrometheusQuery) (*backend.QueryDataResponse, error) { +func runQuery(response []byte, sq storedPrometheusQuery) (*backend.QueryDataResponse, error) { api, err := makeMockedApi(response) if err != nil { return nil, err @@ -134,14 +125,47 @@ func runQuery(response []byte, query PrometheusQuery) (*backend.QueryDataRespons tracer := tracing.InitializeTracerForTest() - s := Buffered{ + qm := QueryModel{ + RangeQuery: sq.RangeQuery, + Expr: sq.Expr, + Interval: fmt.Sprintf("%ds", sq.Step), + IntervalMS: sq.Step * 1000, + LegendFormat: sq.LegendFormat, + } + + b := Buffered{ intervalCalculator: intervalv2.NewCalculator(), tracer: tracer, TimeInterval: "15s", log: &fakeLogger{}, client: api, } - return s.runQueries(context.Background(), []*PrometheusQuery{&query}) + + data, err := json.Marshal(&qm) + if err != nil { + return nil, err + } + + req := &backend.QueryDataRequest{ + Queries: []backend.DataQuery{ + { + TimeRange: backend.TimeRange{ + From: time.Unix(sq.Start, 0), + To: time.Unix(sq.End, 0), + }, + RefID: sq.RefId, + Interval: time.Second * time.Duration(sq.Step), + JSON: json.RawMessage(data), + }, + }, + } + + queries, err := b.parseTimeSeriesQuery(req) + if err != nil { + return nil, err + } + + return b.runQueries(context.Background(), queries) } type fakeLogger struct { diff --git a/pkg/tsdb/prometheus/buffered/time_series_query.go b/pkg/tsdb/prometheus/buffered/time_series_query.go index 4fed7d2f3f9..fd32879d8f4 100644 --- a/pkg/tsdb/prometheus/buffered/time_series_query.go +++ b/pkg/tsdb/prometheus/buffered/time_series_query.go @@ -379,11 +379,7 @@ func matrixToDataFrames(matrix model.Matrix, query *PrometheusQuery, frames data for i, k := range v.Values { timeField.Set(i, k.Timestamp.Time().UTC()) - value := float64(k.Value) - - if !math.IsNaN(value) { - valueField.Set(i, value) - } + valueField.Set(i, float64(k.Value)) } name := formatLegend(v.Metric, query) diff --git a/pkg/tsdb/prometheus/buffered/time_series_query_test.go b/pkg/tsdb/prometheus/buffered/time_series_query_test.go index f1fc8f2c64d..c54a5576353 100644 --- a/pkg/tsdb/prometheus/buffered/time_series_query_test.go +++ b/pkg/tsdb/prometheus/buffered/time_series_query_test.go @@ -836,7 +836,7 @@ func TestPrometheus_parseTimeSeriesResponse(t *testing.T) { require.NoError(t, err) require.Equal(t, "Value", res[0].Fields[1].Name) - require.Equal(t, float64(0), res[0].Fields[1].At(0)) + require.True(t, math.IsNaN(res[0].Fields[1].At(0).(float64))) }) t.Run("vector response should be parsed normally", func(t *testing.T) { diff --git a/pkg/tsdb/prometheus/querydata/framing_test.go b/pkg/tsdb/prometheus/querydata/framing_test.go index 0248fb1ecfe..b11cc81bdba 100644 --- a/pkg/tsdb/prometheus/querydata/framing_test.go +++ b/pkg/tsdb/prometheus/querydata/framing_test.go @@ -32,13 +32,14 @@ func TestMatrixResponses(t *testing.T) { {name: "parse a simple matrix response with value missing steps", filepath: "range_missing"}, {name: "parse a response with Infinity", filepath: "range_infinity"}, {name: "parse a response with NaN", filepath: "range_nan"}, + {name: "parse a response with legendFormat __auto", filepath: "range_auto"}, } for _, test := range tt { enableWideSeries := false queryFileName := filepath.Join("../testdata", test.filepath+".query.json") responseFileName := filepath.Join("../testdata", test.filepath+".result.json") - goldenFileName := test.filepath + ".result.streaming.golden" + goldenFileName := test.filepath + ".result.golden" t.Run(test.name, goldenScenario(test.name, queryFileName, responseFileName, goldenFileName, enableWideSeries)) enableWideSeries = true goldenFileName = test.filepath + ".result.streaming-wide.golden" @@ -71,12 +72,13 @@ func goldenScenario(name, queryFileName, responseFileName, goldenFileName string // struct here, because it has `time.time` and `time.duration` fields that // cannot be unmarshalled from JSON automatically. type storedPrometheusQuery struct { - RefId string - RangeQuery bool - Start int64 - End int64 - Step int64 - Expr string + RefId string + RangeQuery bool + Start int64 + End int64 + Step int64 + Expr string + LegendFormat string } func loadStoredQuery(fileName string) (*backend.QueryDataRequest, error) { @@ -94,10 +96,11 @@ func loadStoredQuery(fileName string) (*backend.QueryDataRequest, error) { } qm := models.QueryModel{ - RangeQuery: sq.RangeQuery, - Expr: sq.Expr, - Interval: fmt.Sprintf("%ds", sq.Step), - IntervalMS: sq.Step * 1000, + RangeQuery: sq.RangeQuery, + Expr: sq.Expr, + Interval: fmt.Sprintf("%ds", sq.Step), + IntervalMS: sq.Step * 1000, + LegendFormat: sq.LegendFormat, } data, err := json.Marshal(&qm) diff --git a/pkg/tsdb/prometheus/querydata/response.go b/pkg/tsdb/prometheus/querydata/response.go index 258b06e5edf..f3b9dde6732 100644 --- a/pkg/tsdb/prometheus/querydata/response.go +++ b/pkg/tsdb/prometheus/querydata/response.go @@ -108,11 +108,11 @@ func getName(q *models.Query, field *data.Field) string { labels := field.Labels legend := metricNameFromLabels(field) - if q.LegendFormat == legendFormatAuto && len(labels) > 0 { - return "" - } - - if q.LegendFormat != "" { + if q.LegendFormat == legendFormatAuto { + if len(labels) > 0 { + legend = "" + } + } else if q.LegendFormat != "" { result := legendFormatRegexp.ReplaceAllFunc([]byte(q.LegendFormat), func(in []byte) []byte { labelName := strings.Replace(string(in), "{{", "", 1) labelName = strings.Replace(labelName, "}}", "", 1) diff --git a/pkg/tsdb/prometheus/testdata/range_auto.query.json b/pkg/tsdb/prometheus/testdata/range_auto.query.json new file mode 100644 index 00000000000..b7e04d0e71a --- /dev/null +++ b/pkg/tsdb/prometheus/testdata/range_auto.query.json @@ -0,0 +1,9 @@ +{ + "RefId": "A", + "RangeQuery": true, + "Start": 1664376185, + "End": 1664376485, + "Step": 1, + "LegendFormat": "__auto", + "Expr": "histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[$__rate_interval])) by (le))" +} diff --git a/pkg/tsdb/prometheus/testdata/range_auto.result.golden.jsonc b/pkg/tsdb/prometheus/testdata/range_auto.result.golden.jsonc new file mode 100644 index 00000000000..31bb10be6d2 --- /dev/null +++ b/pkg/tsdb/prometheus/testdata/range_auto.result.golden.jsonc @@ -0,0 +1,679 @@ +// 🌟 This was machine generated. Do not edit. 🌟 +// +// Frame[0] { +// "type": "timeseries-many", +// "custom": { +// "resultType": "matrix" +// }, +// "executedQueryString": "Expr: histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le))\nStep: 1s" +// } +// Name: histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le)) +// Dimensions: 2 Fields by 301 Rows +// +-----------------------------------+----------------------+ +// | Name: Time | Name: Value | +// | Labels: | Labels: | +// | Type: []time.Time | Type: []float64 | +// +-----------------------------------+----------------------+ +// | 2022-09-28 14:43:05.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:06.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:07.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:08.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:09.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:10.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:11.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:12.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:13.491 +0000 UTC | 0.004754481132075472 | +// | ... | ... | +// +-----------------------------------+----------------------+ +// +// +// 🌟 This was machine generated. Do not edit. 🌟 +{ + "frames": [ + { + "schema": { + "name": "histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le))", + "meta": { + "type": "timeseries-many", + "custom": { + "resultType": "matrix" + }, + "executedQueryString": "Expr: histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le))\nStep: 1s" + }, + "fields": [ + { + "name": "Time", + "type": "time", + "typeInfo": { + "frame": "time.Time" + }, + "config": { + "interval": 1000 + } + }, + { + "name": "Value", + "type": "number", + "typeInfo": { + "frame": "float64" + }, + "labels": {}, + "config": { + "displayNameFromDS": "histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le))" + } + } + ] + }, + "data": { + "values": [ + [ + 1664376185491, + 1664376186491, + 1664376187491, + 1664376188491, + 1664376189491, + 1664376190491, + 1664376191491, + 1664376192491, + 1664376193491, + 1664376194491, + 1664376195491, + 1664376196491, + 1664376197491, + 1664376198491, + 1664376199491, + 1664376200491, + 1664376201491, + 1664376202491, + 1664376203491, + 1664376204491, + 1664376205491, + 1664376206491, + 1664376207491, + 1664376208491, + 1664376209491, + 1664376210491, + 1664376211491, + 1664376212491, + 1664376213491, + 1664376214491, + 1664376215491, + 1664376216491, + 1664376217491, + 1664376218491, + 1664376219491, + 1664376220491, + 1664376221491, + 1664376222491, + 1664376223491, + 1664376224491, + 1664376225491, + 1664376226491, + 1664376227491, + 1664376228491, + 1664376229491, + 1664376230491, + 1664376231491, + 1664376232491, + 1664376233491, + 1664376234491, + 1664376235491, + 1664376236491, + 1664376237491, + 1664376238491, + 1664376239491, + 1664376240491, + 1664376241491, + 1664376242491, + 1664376243491, + 1664376244491, + 1664376245491, + 1664376246491, + 1664376247491, + 1664376248491, + 1664376249491, + 1664376250491, + 1664376251491, + 1664376252491, + 1664376253491, + 1664376254491, + 1664376255491, + 1664376256491, + 1664376257491, + 1664376258491, + 1664376259491, + 1664376260491, + 1664376261491, + 1664376262491, + 1664376263491, + 1664376264491, + 1664376265491, + 1664376266491, + 1664376267491, + 1664376268491, + 1664376269491, + 1664376270491, + 1664376271491, + 1664376272491, + 1664376273491, + 1664376274491, + 1664376275491, + 1664376276491, + 1664376277491, + 1664376278491, + 1664376279491, + 1664376280491, + 1664376281491, + 1664376282491, + 1664376283491, + 1664376284491, + 1664376285491, + 1664376286491, + 1664376287491, + 1664376288491, + 1664376289491, + 1664376290491, + 1664376291491, + 1664376292491, + 1664376293491, + 1664376294491, + 1664376295491, + 1664376296491, + 1664376297491, + 1664376298491, + 1664376299491, + 1664376300491, + 1664376301491, + 1664376302491, + 1664376303491, + 1664376304491, + 1664376305491, + 1664376306491, + 1664376307491, + 1664376308491, + 1664376309491, + 1664376310491, + 1664376311491, + 1664376312491, + 1664376313491, + 1664376314491, + 1664376315491, + 1664376316491, + 1664376317491, + 1664376318491, + 1664376319491, + 1664376320491, + 1664376321491, + 1664376322491, + 1664376323491, + 1664376324491, + 1664376325491, + 1664376326491, + 1664376327491, + 1664376328491, + 1664376329491, + 1664376330491, + 1664376331491, + 1664376332491, + 1664376333491, + 1664376334491, + 1664376335491, + 1664376336491, + 1664376337491, + 1664376338491, + 1664376339491, + 1664376340491, + 1664376341491, + 1664376342491, + 1664376343491, + 1664376344491, + 1664376345491, + 1664376346491, + 1664376347491, + 1664376348491, + 1664376349491, + 1664376350491, + 1664376351491, + 1664376352491, + 1664376353491, + 1664376354491, + 1664376355491, + 1664376356491, + 1664376357491, + 1664376358491, + 1664376359491, + 1664376360491, + 1664376361491, + 1664376362491, + 1664376363491, + 1664376364491, + 1664376365491, + 1664376366491, + 1664376367491, + 1664376368491, + 1664376369491, + 1664376370491, + 1664376371491, + 1664376372491, + 1664376373491, + 1664376374491, + 1664376375491, + 1664376376491, + 1664376377491, + 1664376378491, + 1664376379491, + 1664376380491, + 1664376381491, + 1664376382491, + 1664376383491, + 1664376384491, + 1664376385491, + 1664376386491, + 1664376387491, + 1664376388491, + 1664376389491, + 1664376390491, + 1664376391491, + 1664376392491, + 1664376393491, + 1664376394491, + 1664376395491, + 1664376396491, + 1664376397491, + 1664376398491, + 1664376399491, + 1664376400491, + 1664376401491, + 1664376402491, + 1664376403491, + 1664376404491, + 1664376405491, + 1664376406491, + 1664376407491, + 1664376408491, + 1664376409491, + 1664376410491, + 1664376411491, + 1664376412491, + 1664376413491, + 1664376414491, + 1664376415491, + 1664376416491, + 1664376417491, + 1664376418491, + 1664376419491, + 1664376420491, + 1664376421491, + 1664376422491, + 1664376423491, + 1664376424491, + 1664376425491, + 1664376426491, + 1664376427491, + 1664376428491, + 1664376429491, + 1664376430491, + 1664376431491, + 1664376432491, + 1664376433491, + 1664376434491, + 1664376435491, + 1664376436491, + 1664376437491, + 1664376438491, + 1664376439491, + 1664376440491, + 1664376441491, + 1664376442491, + 1664376443491, + 1664376444491, + 1664376445491, + 1664376446491, + 1664376447491, + 1664376448491, + 1664376449491, + 1664376450491, + 1664376451491, + 1664376452491, + 1664376453491, + 1664376454491, + 1664376455491, + 1664376456491, + 1664376457491, + 1664376458491, + 1664376459491, + 1664376460491, + 1664376461491, + 1664376462491, + 1664376463491, + 1664376464491, + 1664376465491, + 1664376466491, + 1664376467491, + 1664376468491, + 1664376469491, + 1664376470491, + 1664376471491, + 1664376472491, + 1664376473491, + 1664376474491, + 1664376475491, + 1664376476491, + 1664376477491, + 1664376478491, + 1664376479491, + 1664376480491, + 1664376481491, + 1664376482491, + 1664376483491, + 1664376484491, + 1664376485491 + ], + [ + 0.004754464285714286, + 0.004754464285714286, + 0.004754464285714286, + 0.004754464285714286, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/pkg/tsdb/prometheus/testdata/range_auto.result.json b/pkg/tsdb/prometheus/testdata/range_auto.result.json new file mode 100644 index 00000000000..d1b085b2c3b --- /dev/null +++ b/pkg/tsdb/prometheus/testdata/range_auto.result.json @@ -0,0 +1 @@ +{"status":"success","data":{"resultType":"matrix","result":[{"metric":{},"values":[[1664376185.491,"0.004754464285714286"],[1664376186.491,"0.004754464285714286"],[1664376187.491,"0.004754464285714286"],[1664376188.491,"0.004754464285714286"],[1664376189.491,"0.004754481132075472"],[1664376190.491,"0.004754481132075472"],[1664376191.491,"0.004754481132075472"],[1664376192.491,"0.004754481132075472"],[1664376193.491,"0.004754481132075472"],[1664376194.491,"0.004754481132075472"],[1664376195.491,"0.004754532442748091"],[1664376196.491,"0.004754532442748091"],[1664376197.491,"0.004754532442748091"],[1664376198.491,"0.004754532442748091"],[1664376199.491,"0.004754532442748091"],[1664376200.491,"0.004754532442748091"],[1664376201.491,"0.004754532442748091"],[1664376202.491,"0.004754532442748091"],[1664376203.491,"0.004754532442748091"],[1664376204.491,"0.004754620622568094"],[1664376205.491,"0.004754620622568094"],[1664376206.491,"0.004754620622568094"],[1664376207.491,"0.004754620622568094"],[1664376208.491,"0.004754620622568094"],[1664376209.491,"0.004754620622568094"],[1664376210.491,"0.00475462962962963"],[1664376211.491,"0.00475462962962963"],[1664376212.491,"0.00475462962962963"],[1664376213.491,"0.00475462962962963"],[1664376214.491,"0.00475462962962963"],[1664376215.491,"0.00475462962962963"],[1664376216.491,"0.00475462962962963"],[1664376217.491,"0.00475462962962963"],[1664376218.491,"0.00475462962962963"],[1664376219.491,"0.004754625121713728"],[1664376220.491,"0.004754625121713728"],[1664376221.491,"0.004754625121713728"],[1664376222.491,"0.004754625121713728"],[1664376223.491,"0.004754625121713728"],[1664376224.491,"0.004754625121713728"],[1664376225.491,"0.004754638671874999"],[1664376226.491,"0.004754638671874999"],[1664376227.491,"0.004754638671874999"],[1664376228.491,"0.004754638671874999"],[1664376229.491,"0.004754638671874999"],[1664376230.491,"0.004754638671874999"],[1664376231.491,"0.004754638671874999"],[1664376232.491,"0.004754638671874999"],[1664376233.491,"0.004754638671874999"],[1664376234.491,"0.00475"],[1664376235.491,"0.00475"],[1664376236.491,"0.00475"],[1664376237.491,"0.00475"],[1664376238.491,"0.00475"],[1664376239.491,"0.00475"],[1664376240.491,"0.00475"],[1664376241.491,"0.00475"],[1664376242.491,"0.00475"],[1664376243.491,"0.00475"],[1664376244.491,"0.00475"],[1664376245.491,"0.00475"],[1664376246.491,"0.00475"],[1664376247.491,"0.00475"],[1664376248.491,"0.00475"],[1664376249.491,"0.00475"],[1664376250.491,"0.00475"],[1664376251.491,"0.00475"],[1664376252.491,"0.00475"],[1664376253.491,"0.00475"],[1664376254.491,"0.00475"],[1664376255.491,"0.00475"],[1664376256.491,"0.00475"],[1664376257.491,"0.00475"],[1664376258.491,"0.00475"],[1664376259.491,"0.00475"],[1664376260.491,"0.00475"],[1664376261.491,"0.00475"],[1664376262.491,"0.00475"],[1664376263.491,"0.00475"],[1664376264.491,"0.004750000000000001"],[1664376265.491,"0.004750000000000001"],[1664376266.491,"0.004750000000000001"],[1664376267.491,"0.004750000000000001"],[1664376268.491,"0.004750000000000001"],[1664376269.491,"0.004750000000000001"],[1664376270.491,"0.00475"],[1664376271.491,"0.00475"],[1664376272.491,"0.00475"],[1664376273.491,"0.00475"],[1664376274.491,"0.00475"],[1664376275.491,"0.00475"],[1664376276.491,"0.00475"],[1664376277.491,"0.00475"],[1664376278.491,"0.00475"],[1664376279.491,"0.00475"],[1664376280.491,"0.00475"],[1664376281.491,"0.00475"],[1664376282.491,"0.00475"],[1664376283.491,"0.00475"],[1664376284.491,"0.00475"],[1664376285.491,"0.00475"],[1664376286.491,"0.00475"],[1664376287.491,"0.00475"],[1664376288.491,"0.00475"],[1664376289.491,"0.00475"],[1664376290.491,"0.00475"],[1664376291.491,"0.00475"],[1664376292.491,"0.00475"],[1664376293.491,"0.00475"],[1664376294.491,"0.004750000000000001"],[1664376295.491,"0.004750000000000001"],[1664376296.491,"0.004750000000000001"],[1664376297.491,"0.004750000000000001"],[1664376298.491,"0.004750000000000001"],[1664376299.491,"0.004750000000000001"],[1664376300.491,"0.00475"],[1664376301.491,"0.00475"],[1664376302.491,"0.00475"],[1664376303.491,"0.00475"],[1664376304.491,"0.00475"],[1664376305.491,"0.00475"],[1664376306.491,"0.00475"],[1664376307.491,"0.00475"],[1664376308.491,"0.00475"],[1664376309.491,"0.07309523809523814"],[1664376310.491,"0.07309523809523814"],[1664376311.491,"0.07309523809523814"],[1664376312.491,"0.07309523809523814"],[1664376313.491,"0.07309523809523814"],[1664376314.491,"0.07309523809523814"],[1664376315.491,"0.09168949771689497"],[1664376316.491,"0.09168949771689497"],[1664376317.491,"0.09168949771689497"],[1664376318.491,"0.09168949771689497"],[1664376319.491,"0.09168949771689497"],[1664376320.491,"0.09168949771689497"],[1664376321.491,"0.09168949771689497"],[1664376322.491,"0.09168949771689497"],[1664376323.491,"0.09168949771689497"],[1664376324.491,"0.09621014492753623"],[1664376325.491,"0.09621014492753623"],[1664376326.491,"0.09621014492753623"],[1664376327.491,"0.09621014492753623"],[1664376328.491,"0.09621014492753623"],[1664376329.491,"0.09621014492753623"],[1664376330.491,"0.09886509635974303"],[1664376331.491,"0.09886509635974303"],[1664376332.491,"0.09886509635974303"],[1664376333.491,"0.09886509635974303"],[1664376334.491,"0.09886509635974303"],[1664376335.491,"0.09886509635974303"],[1664376336.491,"0.09886509635974303"],[1664376337.491,"0.09886509635974303"],[1664376338.491,"0.09886509635974303"],[1664376339.491,"0.09992233009708738"],[1664376340.491,"0.09992233009708738"],[1664376341.491,"0.09992233009708738"],[1664376342.491,"0.09992233009708738"],[1664376343.491,"0.09992233009708738"],[1664376344.491,"0.09992233009708738"],[1664376345.491,"0.09990847784200386"],[1664376346.491,"0.09990847784200386"],[1664376347.491,"0.09990847784200386"],[1664376348.491,"0.09990847784200386"],[1664376349.491,"0.09990847784200386"],[1664376350.491,"0.09990847784200386"],[1664376351.491,"0.09990847784200386"],[1664376352.491,"0.09990847784200386"],[1664376353.491,"0.09990847784200386"],[1664376354.491,"0.09897701149425286"],[1664376355.491,"0.09897701149425286"],[1664376356.491,"0.09897701149425286"],[1664376357.491,"0.09897701149425286"],[1664376358.491,"0.09897701149425286"],[1664376359.491,"0.09897701149425286"],[1664376360.491,"0.09700833333333335"],[1664376361.491,"0.09700833333333335"],[1664376362.491,"0.09700833333333335"],[1664376363.491,"0.09700833333333335"],[1664376364.491,"0.09700833333333335"],[1664376365.491,"0.09700833333333335"],[1664376366.491,"0.09700833333333335"],[1664376367.491,"0.09700833333333335"],[1664376368.491,"0.09700833333333335"],[1664376369.491,"0.09188218390804595"],[1664376370.491,"0.09188218390804595"],[1664376371.491,"0.09188218390804595"],[1664376372.491,"0.09188218390804595"],[1664376373.491,"0.09188218390804595"],[1664376374.491,"0.09188218390804595"],[1664376375.491,"0.05788461538461537"],[1664376376.491,"0.05788461538461537"],[1664376377.491,"0.05788461538461537"],[1664376378.491,"0.05788461538461537"],[1664376379.491,"0.05788461538461537"],[1664376380.491,"0.05788461538461537"],[1664376381.491,"0.05788461538461537"],[1664376382.491,"0.05788461538461537"],[1664376383.491,"0.05788461538461537"],[1664376384.491,"0.004767840375586855"],[1664376385.491,"0.004767840375586855"],[1664376386.491,"0.004767840375586855"],[1664376387.491,"0.004767840375586855"],[1664376388.491,"0.004767840375586855"],[1664376389.491,"0.004767840375586855"],[1664376390.491,"0.004750000000000001"],[1664376391.491,"0.004750000000000001"],[1664376392.491,"0.004750000000000001"],[1664376393.491,"0.004750000000000001"],[1664376394.491,"0.004750000000000001"],[1664376395.491,"0.004750000000000001"],[1664376396.491,"0.004750000000000001"],[1664376397.491,"0.004750000000000001"],[1664376398.491,"0.004750000000000001"],[1664376399.491,"0.00475"],[1664376400.491,"0.00475"],[1664376401.491,"0.00475"],[1664376402.491,"0.00475"],[1664376403.491,"0.00475"],[1664376404.491,"0.00475"],[1664376405.491,"0.00475"],[1664376406.491,"0.00475"],[1664376407.491,"0.00475"],[1664376408.491,"0.00475"],[1664376409.491,"0.00475"],[1664376410.491,"0.00475"],[1664376411.491,"0.00475"],[1664376412.491,"0.00475"],[1664376413.491,"0.00475"],[1664376414.491,"0.00475"],[1664376415.491,"0.00475"],[1664376416.491,"0.00475"],[1664376417.491,"0.00475"],[1664376418.491,"0.00475"],[1664376419.491,"0.00475"],[1664376420.491,"0.00475"],[1664376421.491,"0.00475"],[1664376422.491,"0.00475"],[1664376423.491,"0.00475"],[1664376424.491,"0.00475"],[1664376425.491,"0.00475"],[1664376426.491,"0.00475"],[1664376427.491,"0.00475"],[1664376428.491,"0.00475"],[1664376429.491,"0.00475"],[1664376430.491,"0.00475"],[1664376431.491,"0.00475"],[1664376432.491,"0.00475"],[1664376433.491,"0.00475"],[1664376434.491,"0.00475"],[1664376435.491,"0.00475"],[1664376436.491,"0.00475"],[1664376437.491,"0.00475"],[1664376438.491,"0.00475"],[1664376439.491,"0.00475"],[1664376440.491,"0.00475"],[1664376441.491,"0.00475"],[1664376442.491,"0.00475"],[1664376443.491,"0.00475"],[1664376444.491,"0.00475"],[1664376445.491,"0.00475"],[1664376446.491,"0.00475"],[1664376447.491,"0.00475"],[1664376448.491,"0.00475"],[1664376449.491,"0.00475"],[1664376450.491,"0.00475"],[1664376451.491,"0.00475"],[1664376452.491,"0.00475"],[1664376453.491,"0.00475"],[1664376454.491,"0.00475"],[1664376455.491,"0.00475"],[1664376456.491,"0.00475"],[1664376457.491,"0.00475"],[1664376458.491,"0.00475"],[1664376459.491,"0.004750000000000001"],[1664376460.491,"0.004750000000000001"],[1664376461.491,"0.004750000000000001"],[1664376462.491,"0.004750000000000001"],[1664376463.491,"0.004750000000000001"],[1664376464.491,"0.004750000000000001"],[1664376465.491,"0.004749999999999999"],[1664376466.491,"0.004749999999999999"],[1664376467.491,"0.004749999999999999"],[1664376468.491,"0.004749999999999999"],[1664376469.491,"0.004749999999999999"],[1664376470.491,"0.004749999999999999"],[1664376471.491,"0.004749999999999999"],[1664376472.491,"0.004749999999999999"],[1664376473.491,"0.004749999999999999"],[1664376474.491,"0.00475"],[1664376475.491,"0.00475"],[1664376476.491,"0.00475"],[1664376477.491,"0.00475"],[1664376478.491,"0.00475"],[1664376479.491,"0.00475"],[1664376480.491,"0.00475"],[1664376481.491,"0.00475"],[1664376482.491,"0.00475"],[1664376483.491,"0.00475"],[1664376484.491,"0.00475"],[1664376485.491,"0.00475"]]}]}} \ No newline at end of file diff --git a/pkg/tsdb/prometheus/testdata/range_auto.result.streaming-wide.golden.jsonc b/pkg/tsdb/prometheus/testdata/range_auto.result.streaming-wide.golden.jsonc new file mode 100644 index 00000000000..1ebe22c2117 --- /dev/null +++ b/pkg/tsdb/prometheus/testdata/range_auto.result.streaming-wide.golden.jsonc @@ -0,0 +1,676 @@ +// 🌟 This was machine generated. Do not edit. 🌟 +// +// Frame[0] { +// "type": "timeseries-wide", +// "custom": { +// "resultType": "matrix" +// }, +// "executedQueryString": "Expr: histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le))\nStep: 1s" +// } +// Name: +// Dimensions: 2 Fields by 301 Rows +// +-----------------------------------+----------------------------------------------------------------------------------------------+ +// | Name: Time | Name: histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le)) | +// | Labels: | Labels: | +// | Type: []time.Time | Type: []*float64 | +// +-----------------------------------+----------------------------------------------------------------------------------------------+ +// | 2022-09-28 14:43:05.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:06.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:07.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:08.491 +0000 UTC | 0.004754464285714286 | +// | 2022-09-28 14:43:09.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:10.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:11.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:12.491 +0000 UTC | 0.004754481132075472 | +// | 2022-09-28 14:43:13.491 +0000 UTC | 0.004754481132075472 | +// | ... | ... | +// +-----------------------------------+----------------------------------------------------------------------------------------------+ +// +// +// 🌟 This was machine generated. Do not edit. 🌟 +{ + "frames": [ + { + "schema": { + "meta": { + "type": "timeseries-wide", + "custom": { + "resultType": "matrix" + }, + "executedQueryString": "Expr: histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le))\nStep: 1s" + }, + "fields": [ + { + "name": "Time", + "type": "time", + "typeInfo": { + "frame": "time.Time" + }, + "config": { + "interval": 1000 + } + }, + { + "name": "histogram_quantile(0.95, sum(rate(tns_request_duration_seconds_bucket[1m0s])) by (le))", + "type": "number", + "typeInfo": { + "frame": "float64", + "nullable": true + }, + "labels": {} + } + ] + }, + "data": { + "values": [ + [ + 1664376185491, + 1664376186491, + 1664376187491, + 1664376188491, + 1664376189491, + 1664376190491, + 1664376191491, + 1664376192491, + 1664376193491, + 1664376194491, + 1664376195491, + 1664376196491, + 1664376197491, + 1664376198491, + 1664376199491, + 1664376200491, + 1664376201491, + 1664376202491, + 1664376203491, + 1664376204491, + 1664376205491, + 1664376206491, + 1664376207491, + 1664376208491, + 1664376209491, + 1664376210491, + 1664376211491, + 1664376212491, + 1664376213491, + 1664376214491, + 1664376215491, + 1664376216491, + 1664376217491, + 1664376218491, + 1664376219491, + 1664376220491, + 1664376221491, + 1664376222491, + 1664376223491, + 1664376224491, + 1664376225491, + 1664376226491, + 1664376227491, + 1664376228491, + 1664376229491, + 1664376230491, + 1664376231491, + 1664376232491, + 1664376233491, + 1664376234491, + 1664376235491, + 1664376236491, + 1664376237491, + 1664376238491, + 1664376239491, + 1664376240491, + 1664376241491, + 1664376242491, + 1664376243491, + 1664376244491, + 1664376245491, + 1664376246491, + 1664376247491, + 1664376248491, + 1664376249491, + 1664376250491, + 1664376251491, + 1664376252491, + 1664376253491, + 1664376254491, + 1664376255491, + 1664376256491, + 1664376257491, + 1664376258491, + 1664376259491, + 1664376260491, + 1664376261491, + 1664376262491, + 1664376263491, + 1664376264491, + 1664376265491, + 1664376266491, + 1664376267491, + 1664376268491, + 1664376269491, + 1664376270491, + 1664376271491, + 1664376272491, + 1664376273491, + 1664376274491, + 1664376275491, + 1664376276491, + 1664376277491, + 1664376278491, + 1664376279491, + 1664376280491, + 1664376281491, + 1664376282491, + 1664376283491, + 1664376284491, + 1664376285491, + 1664376286491, + 1664376287491, + 1664376288491, + 1664376289491, + 1664376290491, + 1664376291491, + 1664376292491, + 1664376293491, + 1664376294491, + 1664376295491, + 1664376296491, + 1664376297491, + 1664376298491, + 1664376299491, + 1664376300491, + 1664376301491, + 1664376302491, + 1664376303491, + 1664376304491, + 1664376305491, + 1664376306491, + 1664376307491, + 1664376308491, + 1664376309491, + 1664376310491, + 1664376311491, + 1664376312491, + 1664376313491, + 1664376314491, + 1664376315491, + 1664376316491, + 1664376317491, + 1664376318491, + 1664376319491, + 1664376320491, + 1664376321491, + 1664376322491, + 1664376323491, + 1664376324491, + 1664376325491, + 1664376326491, + 1664376327491, + 1664376328491, + 1664376329491, + 1664376330491, + 1664376331491, + 1664376332491, + 1664376333491, + 1664376334491, + 1664376335491, + 1664376336491, + 1664376337491, + 1664376338491, + 1664376339491, + 1664376340491, + 1664376341491, + 1664376342491, + 1664376343491, + 1664376344491, + 1664376345491, + 1664376346491, + 1664376347491, + 1664376348491, + 1664376349491, + 1664376350491, + 1664376351491, + 1664376352491, + 1664376353491, + 1664376354491, + 1664376355491, + 1664376356491, + 1664376357491, + 1664376358491, + 1664376359491, + 1664376360491, + 1664376361491, + 1664376362491, + 1664376363491, + 1664376364491, + 1664376365491, + 1664376366491, + 1664376367491, + 1664376368491, + 1664376369491, + 1664376370491, + 1664376371491, + 1664376372491, + 1664376373491, + 1664376374491, + 1664376375491, + 1664376376491, + 1664376377491, + 1664376378491, + 1664376379491, + 1664376380491, + 1664376381491, + 1664376382491, + 1664376383491, + 1664376384491, + 1664376385491, + 1664376386491, + 1664376387491, + 1664376388491, + 1664376389491, + 1664376390491, + 1664376391491, + 1664376392491, + 1664376393491, + 1664376394491, + 1664376395491, + 1664376396491, + 1664376397491, + 1664376398491, + 1664376399491, + 1664376400491, + 1664376401491, + 1664376402491, + 1664376403491, + 1664376404491, + 1664376405491, + 1664376406491, + 1664376407491, + 1664376408491, + 1664376409491, + 1664376410491, + 1664376411491, + 1664376412491, + 1664376413491, + 1664376414491, + 1664376415491, + 1664376416491, + 1664376417491, + 1664376418491, + 1664376419491, + 1664376420491, + 1664376421491, + 1664376422491, + 1664376423491, + 1664376424491, + 1664376425491, + 1664376426491, + 1664376427491, + 1664376428491, + 1664376429491, + 1664376430491, + 1664376431491, + 1664376432491, + 1664376433491, + 1664376434491, + 1664376435491, + 1664376436491, + 1664376437491, + 1664376438491, + 1664376439491, + 1664376440491, + 1664376441491, + 1664376442491, + 1664376443491, + 1664376444491, + 1664376445491, + 1664376446491, + 1664376447491, + 1664376448491, + 1664376449491, + 1664376450491, + 1664376451491, + 1664376452491, + 1664376453491, + 1664376454491, + 1664376455491, + 1664376456491, + 1664376457491, + 1664376458491, + 1664376459491, + 1664376460491, + 1664376461491, + 1664376462491, + 1664376463491, + 1664376464491, + 1664376465491, + 1664376466491, + 1664376467491, + 1664376468491, + 1664376469491, + 1664376470491, + 1664376471491, + 1664376472491, + 1664376473491, + 1664376474491, + 1664376475491, + 1664376476491, + 1664376477491, + 1664376478491, + 1664376479491, + 1664376480491, + 1664376481491, + 1664376482491, + 1664376483491, + 1664376484491, + 1664376485491 + ], + [ + 0.004754464285714286, + 0.004754464285714286, + 0.004754464285714286, + 0.004754464285714286, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754481132075472, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754532442748091, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.004754620622568094, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.00475462962962963, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754625121713728, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.004754638671874999, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.07309523809523814, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09168949771689497, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09621014492753623, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09886509635974303, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09992233009708738, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09990847784200386, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09897701149425286, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09700833333333335, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.09188218390804595, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.05788461538461537, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004767840375586855, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004750000000000001, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.004749999999999999, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475, + 0.00475 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/pkg/tsdb/prometheus/testdata/range_infinity.result.streaming.golden.jsonc b/pkg/tsdb/prometheus/testdata/range_infinity.result.streaming.golden.jsonc deleted file mode 100644 index c92e89e3806..00000000000 --- a/pkg/tsdb/prometheus/testdata/range_infinity.result.streaming.golden.jsonc +++ /dev/null @@ -1,86 +0,0 @@ -// 🌟 This was machine generated. Do not edit. 🌟 -// -// Frame[0] { -// "type": "timeseries-many", -// "custom": { -// "resultType": "matrix" -// }, -// "executedQueryString": "Expr: 1 / 0\nStep: 1s" -// } -// Name: 1 / 0 -// Dimensions: 2 Fields by 3 Rows -// +-------------------------------+-----------------+ -// | Name: Time | Name: Value | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []float64 | -// +-------------------------------+-----------------+ -// | 2022-01-11 08:25:30 +0000 UTC | +Inf | -// | 2022-01-11 08:25:31 +0000 UTC | +Inf | -// | 2022-01-11 08:25:32 +0000 UTC | +Inf | -// +-------------------------------+-----------------+ -// -// -// 🌟 This was machine generated. Do not edit. 🌟 -{ - "frames": [ - { - "schema": { - "name": "1 / 0", - "meta": { - "type": "timeseries-many", - "custom": { - "resultType": "matrix" - }, - "executedQueryString": "Expr: 1 / 0\nStep: 1s" - }, - "fields": [ - { - "name": "Time", - "type": "time", - "typeInfo": { - "frame": "time.Time" - }, - "config": { - "interval": 1000 - } - }, - { - "name": "Value", - "type": "number", - "typeInfo": { - "frame": "float64" - }, - "labels": {}, - "config": { - "displayNameFromDS": "1 / 0" - } - } - ] - }, - "data": { - "values": [ - [ - 1641889530000, - 1641889531000, - 1641889532000 - ], - [ - null, - null, - null - ] - ], - "entities": [ - null, - { - "Inf": [ - 0, - 1, - 2 - ] - } - ] - } - } - ] -} \ No newline at end of file diff --git a/pkg/tsdb/prometheus/testdata/range_missing.result.streaming.golden.jsonc b/pkg/tsdb/prometheus/testdata/range_missing.result.streaming.golden.jsonc deleted file mode 100644 index 9795437b844..00000000000 --- a/pkg/tsdb/prometheus/testdata/range_missing.result.streaming.golden.jsonc +++ /dev/null @@ -1,79 +0,0 @@ -// 🌟 This was machine generated. Do not edit. 🌟 -// -// Frame[0] { -// "type": "timeseries-many", -// "custom": { -// "resultType": "matrix" -// }, -// "executedQueryString": "Expr: test1\nStep: 1s" -// } -// Name: go_goroutines{job="prometheus"} -// Dimensions: 2 Fields by 3 Rows -// +-------------------------------+------------------------------------------------+ -// | Name: Time | Name: Value | -// | Labels: | Labels: __name__=go_goroutines, job=prometheus | -// | Type: []time.Time | Type: []float64 | -// +-------------------------------+------------------------------------------------+ -// | 2022-01-11 08:25:33 +0000 UTC | 21 | -// | 2022-01-11 08:25:34 +0000 UTC | 32 | -// | 2022-01-11 08:25:37 +0000 UTC | 43 | -// +-------------------------------+------------------------------------------------+ -// -// -// 🌟 This was machine generated. Do not edit. 🌟 -{ - "frames": [ - { - "schema": { - "name": "go_goroutines{job=\"prometheus\"}", - "meta": { - "type": "timeseries-many", - "custom": { - "resultType": "matrix" - }, - "executedQueryString": "Expr: test1\nStep: 1s" - }, - "fields": [ - { - "name": "Time", - "type": "time", - "typeInfo": { - "frame": "time.Time" - }, - "config": { - "interval": 1000 - } - }, - { - "name": "Value", - "type": "number", - "typeInfo": { - "frame": "float64" - }, - "labels": { - "__name__": "go_goroutines", - "job": "prometheus" - }, - "config": { - "displayNameFromDS": "go_goroutines{job=\"prometheus\"}" - } - } - ] - }, - "data": { - "values": [ - [ - 1641889533000, - 1641889534000, - 1641889537000 - ], - [ - 21, - 32, - 43 - ] - ] - } - } - ] -} \ No newline at end of file diff --git a/pkg/tsdb/prometheus/testdata/range_nan.result.golden.jsonc b/pkg/tsdb/prometheus/testdata/range_nan.result.golden.jsonc index eedad6c17d1..b1e6af215e5 100644 --- a/pkg/tsdb/prometheus/testdata/range_nan.result.golden.jsonc +++ b/pkg/tsdb/prometheus/testdata/range_nan.result.golden.jsonc @@ -14,9 +14,9 @@ // | Labels: | Labels: handler=/api/v1/query_range, job=prometheus | // | Type: []time.Time | Type: []float64 | // +-------------------------------+-----------------------------------------------------+ -// | 2022-01-11 08:25:30 +0000 UTC | 0 | -// | 2022-01-11 08:25:31 +0000 UTC | 0 | -// | 2022-01-11 08:25:32 +0000 UTC | 0 | +// | 2022-01-11 08:25:30 +0000 UTC | NaN | +// | 2022-01-11 08:25:31 +0000 UTC | NaN | +// | 2022-01-11 08:25:32 +0000 UTC | NaN | // +-------------------------------+-----------------------------------------------------+ // // @@ -68,10 +68,20 @@ 1641889532000 ], [ - 0, - 0, - 0 + null, + null, + null ] + ], + "entities": [ + null, + { + "NaN": [ + 0, + 1, + 2 + ] + } ] } } diff --git a/pkg/tsdb/prometheus/testdata/range_nan.result.streaming.golden.jsonc b/pkg/tsdb/prometheus/testdata/range_nan.result.streaming.golden.jsonc deleted file mode 100644 index b1e6af215e5..00000000000 --- a/pkg/tsdb/prometheus/testdata/range_nan.result.streaming.golden.jsonc +++ /dev/null @@ -1,89 +0,0 @@ -// 🌟 This was machine generated. Do not edit. 🌟 -// -// Frame[0] { -// "type": "timeseries-many", -// "custom": { -// "resultType": "matrix" -// }, -// "executedQueryString": "Expr: \nStep: 1s" -// } -// Name: {handler="/api/v1/query_range", job="prometheus"} -// Dimensions: 2 Fields by 3 Rows -// +-------------------------------+-----------------------------------------------------+ -// | Name: Time | Name: Value | -// | Labels: | Labels: handler=/api/v1/query_range, job=prometheus | -// | Type: []time.Time | Type: []float64 | -// +-------------------------------+-----------------------------------------------------+ -// | 2022-01-11 08:25:30 +0000 UTC | NaN | -// | 2022-01-11 08:25:31 +0000 UTC | NaN | -// | 2022-01-11 08:25:32 +0000 UTC | NaN | -// +-------------------------------+-----------------------------------------------------+ -// -// -// 🌟 This was machine generated. Do not edit. 🌟 -{ - "frames": [ - { - "schema": { - "name": "{handler=\"/api/v1/query_range\", job=\"prometheus\"}", - "meta": { - "type": "timeseries-many", - "custom": { - "resultType": "matrix" - }, - "executedQueryString": "Expr: \nStep: 1s" - }, - "fields": [ - { - "name": "Time", - "type": "time", - "typeInfo": { - "frame": "time.Time" - }, - "config": { - "interval": 1000 - } - }, - { - "name": "Value", - "type": "number", - "typeInfo": { - "frame": "float64" - }, - "labels": { - "handler": "/api/v1/query_range", - "job": "prometheus" - }, - "config": { - "displayNameFromDS": "{handler=\"/api/v1/query_range\", job=\"prometheus\"}" - } - } - ] - }, - "data": { - "values": [ - [ - 1641889530000, - 1641889531000, - 1641889532000 - ], - [ - null, - null, - null - ] - ], - "entities": [ - null, - { - "NaN": [ - 0, - 1, - 2 - ] - } - ] - } - } - ] -} \ No newline at end of file diff --git a/pkg/tsdb/prometheus/testdata/range_simple.result.streaming.golden.jsonc b/pkg/tsdb/prometheus/testdata/range_simple.result.streaming.golden.jsonc deleted file mode 100644 index f6128233b99..00000000000 --- a/pkg/tsdb/prometheus/testdata/range_simple.result.streaming.golden.jsonc +++ /dev/null @@ -1,153 +0,0 @@ -// 🌟 This was machine generated. Do not edit. 🌟 -// -// Frame[0] { -// "type": "timeseries-many", -// "custom": { -// "resultType": "matrix" -// }, -// "executedQueryString": "Expr: \nStep: 1s" -// } -// Name: prometheus_http_requests_total{code="200", handler="/api/v1/query_range", job="prometheus"} -// Dimensions: 2 Fields by 3 Rows -// +-----------------------------------+--------------------------------------------------------------------------------------------------------+ -// | Name: Time | Name: Value | -// | Labels: | Labels: __name__=prometheus_http_requests_total, code=200, handler=/api/v1/query_range, job=prometheus | -// | Type: []time.Time | Type: []float64 | -// +-----------------------------------+--------------------------------------------------------------------------------------------------------+ -// | 2022-01-11 08:25:30.123 +0000 UTC | 21 | -// | 2022-01-11 08:25:31.123 +0000 UTC | 32 | -// | 2022-01-11 08:25:32.123 +0000 UTC | 43 | -// +-----------------------------------+--------------------------------------------------------------------------------------------------------+ -// -// -// -// Frame[1] { -// "type": "timeseries-many", -// "custom": { -// "resultType": "matrix" -// }, -// "executedQueryString": "Expr: \nStep: 1s" -// } -// Name: prometheus_http_requests_total{code="400", handler="/api/v1/query_range", job="prometheus"} -// Dimensions: 2 Fields by 2 Rows -// +-----------------------------------+--------------------------------------------------------------------------------------------------------+ -// | Name: Time | Name: Value | -// | Labels: | Labels: __name__=prometheus_http_requests_total, code=400, handler=/api/v1/query_range, job=prometheus | -// | Type: []time.Time | Type: []float64 | -// +-----------------------------------+--------------------------------------------------------------------------------------------------------+ -// | 2022-01-11 08:25:29.123 +0000 UTC | 54 | -// | 2022-01-11 08:25:32.123 +0000 UTC | 76 | -// +-----------------------------------+--------------------------------------------------------------------------------------------------------+ -// -// -// 🌟 This was machine generated. Do not edit. 🌟 -{ - "frames": [ - { - "schema": { - "name": "prometheus_http_requests_total{code=\"200\", handler=\"/api/v1/query_range\", job=\"prometheus\"}", - "meta": { - "type": "timeseries-many", - "custom": { - "resultType": "matrix" - }, - "executedQueryString": "Expr: \nStep: 1s" - }, - "fields": [ - { - "name": "Time", - "type": "time", - "typeInfo": { - "frame": "time.Time" - }, - "config": { - "interval": 1000 - } - }, - { - "name": "Value", - "type": "number", - "typeInfo": { - "frame": "float64" - }, - "labels": { - "__name__": "prometheus_http_requests_total", - "code": "200", - "handler": "/api/v1/query_range", - "job": "prometheus" - }, - "config": { - "displayNameFromDS": "prometheus_http_requests_total{code=\"200\", handler=\"/api/v1/query_range\", job=\"prometheus\"}" - } - } - ] - }, - "data": { - "values": [ - [ - 1641889530123, - 1641889531123, - 1641889532123 - ], - [ - 21, - 32, - 43 - ] - ] - } - }, - { - "schema": { - "name": "prometheus_http_requests_total{code=\"400\", handler=\"/api/v1/query_range\", job=\"prometheus\"}", - "meta": { - "type": "timeseries-many", - "custom": { - "resultType": "matrix" - }, - "executedQueryString": "Expr: \nStep: 1s" - }, - "fields": [ - { - "name": "Time", - "type": "time", - "typeInfo": { - "frame": "time.Time" - }, - "config": { - "interval": 1000 - } - }, - { - "name": "Value", - "type": "number", - "typeInfo": { - "frame": "float64" - }, - "labels": { - "__name__": "prometheus_http_requests_total", - "code": "400", - "handler": "/api/v1/query_range", - "job": "prometheus" - }, - "config": { - "displayNameFromDS": "prometheus_http_requests_total{code=\"400\", handler=\"/api/v1/query_range\", job=\"prometheus\"}" - } - } - ] - }, - "data": { - "values": [ - [ - 1641889529123, - 1641889532123 - ], - [ - 54, - 76 - ] - ] - } - } - ] -} \ No newline at end of file