Prometheus: Various buffered and streaming parsing fixes (#55941)

This commit is contained in:
Todd Treece 2022-10-03 10:26:54 -04:00 committed by GitHub
parent 8984507291
commit 1c61c81dde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 1452 additions and 461 deletions

View File

@ -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 {

View File

@ -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)

View File

@ -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) {

View File

@ -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)

View File

@ -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)

View File

@ -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))"
}

View File

@ -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
]
]
}
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -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
]
]
}
}
]
}

View File

@ -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
]
}
]
}
}
]
}

View File

@ -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
]
]
}
}
]
}

View File

@ -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
]
}
]
}
}

View File

@ -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
]
}
]
}
}
]
}

View File

@ -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
]
]
}
}
]
}