Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
48334ab8
Unverified
Commit
48334ab8
authored
Feb 04, 2021
by
Zoltán Bedi
Committed by
GitHub
Feb 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exemplars: change api to reflect latest changes (#30910)
parent
cbe040b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
33 deletions
+15
-33
public/app/plugins/datasource/prometheus/result_transformer.test.ts
+11
-23
public/app/plugins/datasource/prometheus/result_transformer.ts
+3
-3
public/app/plugins/datasource/prometheus/types.ts
+1
-7
No files found.
public/app/plugins/datasource/prometheus/result_transformer.test.ts
View file @
48334ab8
...
...
@@ -492,13 +492,9 @@ describe('Prometheus Result Transformer', () => {
seriesLabels
:
{
__name__
:
'test'
},
exemplars
:
[
{
scrapeTimestamp
:
1610449069957
,
exemplar
:
{
labels
:
{
traceID
:
'5020b5bc45117f07'
},
value
:
0.002074123
,
timestamp
:
1610449054960
,
hasTimestamp
:
true
,
},
timestamp
:
1610449069957
,
labels
:
{
traceID
:
'5020b5bc45117f07'
},
value
:
0.002074123
,
},
],
},
...
...
@@ -521,28 +517,20 @@ describe('Prometheus Result Transformer', () => {
{
exemplars
:
[
{
scrapeTimestamp
:
1610449070000
,
exemplar
:
{
value
:
5
,
},
timestamp
:
1610449070000
,
value
:
5
,
},
{
scrapeTimestamp
:
1610449070000
,
exemplar
:
{
value
:
1
,
},
timestamp
:
1610449070000
,
value
:
1
,
},
{
scrapeTimestamp
:
1610449070500
,
exemplar
:
{
value
:
13
,
},
timestamp
:
1610449070500
,
value
:
13
,
},
{
scrapeTimestamp
:
1610449070300
,
exemplar
:
{
value
:
20
,
},
timestamp
:
1610449070300
,
value
:
20
,
},
],
},
...
...
public/app/plugins/datasource/prometheus/result_transformer.ts
View file @
48334ab8
...
...
@@ -78,9 +78,9 @@ export function transform(
prometheusResult
.
forEach
((
exemplarData
)
=>
{
const
data
=
exemplarData
.
exemplars
.
map
((
exemplar
)
=>
{
return
{
[
TIME_SERIES_TIME_FIELD_NAME
]:
exemplar
.
scrapeT
imestamp
,
[
TIME_SERIES_VALUE_FIELD_NAME
]:
exemplar
.
exemplar
.
value
,
...
exemplar
.
exemplar
.
labels
,
[
TIME_SERIES_TIME_FIELD_NAME
]:
exemplar
.
t
imestamp
,
[
TIME_SERIES_VALUE_FIELD_NAME
]:
exemplar
.
value
,
...
exemplar
.
labels
,
...
exemplarData
.
seriesLabels
,
};
});
...
...
public/app/plugins/datasource/prometheus/types.ts
View file @
48334ab8
...
...
@@ -69,21 +69,15 @@ export interface Labels {
[
index
:
string
]:
any
;
}
export
interface
ScrapeExemplar
{
exemplar
:
Exemplar
;
scrapeTimestamp
:
number
;
}
export
interface
Exemplar
{
labels
:
Labels
;
value
:
number
;
timestamp
:
number
;
hasTimestamp
:
boolean
;
}
export
interface
PromExemplarData
{
seriesLabels
:
PromMetric
;
exemplars
:
Scrape
Exemplar
[];
exemplars
:
Exemplar
[];
}
export
interface
PromVectorData
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment