mirror of
https://github.com/grafana/grafana.git
synced 2025-01-02 12:17:01 -06:00
Prometheus: Multiply exemplars timestamp to follow api change (#31143)
This commit is contained in:
parent
a17661d198
commit
8c35ed4014
@ -492,7 +492,7 @@ describe('Prometheus Result Transformer', () => {
|
|||||||
seriesLabels: { __name__: 'test' },
|
seriesLabels: { __name__: 'test' },
|
||||||
exemplars: [
|
exemplars: [
|
||||||
{
|
{
|
||||||
timestamp: 1610449069957,
|
timestamp: 1610449069.957,
|
||||||
labels: { traceID: '5020b5bc45117f07' },
|
labels: { traceID: '5020b5bc45117f07' },
|
||||||
value: 0.002074123,
|
value: 0.002074123,
|
||||||
},
|
},
|
||||||
@ -517,19 +517,19 @@ describe('Prometheus Result Transformer', () => {
|
|||||||
{
|
{
|
||||||
exemplars: [
|
exemplars: [
|
||||||
{
|
{
|
||||||
timestamp: 1610449070000,
|
timestamp: 1610449070.0,
|
||||||
value: 5,
|
value: 5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
timestamp: 1610449070000,
|
timestamp: 1610449070.0,
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
timestamp: 1610449070500,
|
timestamp: 1610449070.5,
|
||||||
value: 13,
|
value: 13,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
timestamp: 1610449070300,
|
timestamp: 1610449070.3,
|
||||||
value: 20,
|
value: 20,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -78,7 +78,7 @@ export function transform(
|
|||||||
prometheusResult.forEach((exemplarData) => {
|
prometheusResult.forEach((exemplarData) => {
|
||||||
const data = exemplarData.exemplars.map((exemplar) => {
|
const data = exemplarData.exemplars.map((exemplar) => {
|
||||||
return {
|
return {
|
||||||
[TIME_SERIES_TIME_FIELD_NAME]: exemplar.timestamp,
|
[TIME_SERIES_TIME_FIELD_NAME]: exemplar.timestamp * 1000,
|
||||||
[TIME_SERIES_VALUE_FIELD_NAME]: exemplar.value,
|
[TIME_SERIES_VALUE_FIELD_NAME]: exemplar.value,
|
||||||
...exemplar.labels,
|
...exemplar.labels,
|
||||||
...exemplarData.seriesLabels,
|
...exemplarData.seriesLabels,
|
||||||
|
Loading…
Reference in New Issue
Block a user