Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prometheus: Fix creation of invalid dataframes with exemplars (#75187)
for #73654
- Loading branch information
1 parent
8585a2f
commit b87279b
Showing
4 changed files
with
121 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
pkg/util/converter/testdata/prom-exemplars-diff-labels-frame.jsonc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// 🌟 This was machine generated. Do not edit. 🌟 | ||
// | ||
// Frame[0] { | ||
// "typeVersion": [ | ||
// 0, | ||
// 0 | ||
// ], | ||
// "custom": { | ||
// "resultType": "exemplar" | ||
// } | ||
// } | ||
// Name: | ||
// Dimensions: 4 Fields by 2 Rows | ||
// +-----------------------------------+-----------------+------------------+------------------+ | ||
// | Name: Time | Name: Value | Name: traceID | Name: ztraceID | | ||
// | Labels: | Labels: | Labels: | Labels: | | ||
// | Type: []time.Time | Type: []float64 | Type: []string | Type: []string | | ||
// +-----------------------------------+-----------------+------------------+------------------+ | ||
// | 2020-09-14 15:22:35.479 +0000 UTC | 19 | Olp9XHlq763ccsfa | | | ||
// | 2020-09-14 15:22:45.489 +0000 UTC | 20 | | hCtjygkIHwAN9vs4 | | ||
// +-----------------------------------+-----------------+------------------+------------------+ | ||
// | ||
// | ||
// 🌟 This was machine generated. Do not edit. 🌟 | ||
{ | ||
"status": 200, | ||
"frames": [ | ||
{ | ||
"schema": { | ||
"meta": { | ||
"typeVersion": [ | ||
0, | ||
0 | ||
], | ||
"custom": { | ||
"resultType": "exemplar" | ||
} | ||
}, | ||
"fields": [ | ||
{ | ||
"name": "Time", | ||
"type": "time", | ||
"typeInfo": { | ||
"frame": "time.Time" | ||
} | ||
}, | ||
{ | ||
"name": "Value", | ||
"type": "number", | ||
"typeInfo": { | ||
"frame": "float64" | ||
}, | ||
"labels": {} | ||
}, | ||
{ | ||
"name": "traceID", | ||
"type": "string", | ||
"typeInfo": { | ||
"frame": "string" | ||
} | ||
}, | ||
{ | ||
"name": "ztraceID", | ||
"type": "string", | ||
"typeInfo": { | ||
"frame": "string" | ||
} | ||
} | ||
] | ||
}, | ||
"data": { | ||
"values": [ | ||
[ | ||
1600096955479, | ||
1600096965489 | ||
], | ||
[ | ||
19, | ||
20 | ||
], | ||
[ | ||
"Olp9XHlq763ccsfa", | ||
"" | ||
], | ||
[ | ||
"", | ||
"hCtjygkIHwAN9vs4" | ||
] | ||
] | ||
} | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
pkg/util/converter/testdata/prom-exemplars-diff-labels.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"status": "success", | ||
"data": [ | ||
{ | ||
"exemplars": [ | ||
{ | ||
"labels": { | ||
"traceID": "Olp9XHlq763ccsfa" | ||
}, | ||
"value": "19", | ||
"timestamp": 1600096955.479 | ||
}, | ||
{ | ||
"labels": { | ||
"ztraceID": "hCtjygkIHwAN9vs4" | ||
}, | ||
"value": "20", | ||
"timestamp": 1600096965.489 | ||
} | ||
] | ||
} | ||
] | ||
} |