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
eccc6adf
Commit
eccc6adf
authored
Sep 09, 2019
by
Ryan McKinley
Committed by
Torkel Ödegaard
Sep 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TimeSeries: datasources with labels should export tags (not labels) (#18977)
* merge master * export prometheus tags
parent
14a74057
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
public/app/plugins/datasource/prometheus/result_transformer.ts
+1
-1
public/app/plugins/datasource/prometheus/specs/result_transformer.test.ts
+6
-6
public/app/plugins/datasource/testdata/datasource.ts
+6
-1
No files found.
public/app/plugins/datasource/prometheus/result_transformer.ts
View file @
eccc6adf
...
...
@@ -76,7 +76,7 @@ export class ResultTransformer {
datapoints
:
dps
,
query
:
options
.
query
,
target
:
metricLabel
,
label
s
:
metricData
.
metric
,
tag
s
:
metricData
.
metric
,
};
}
...
...
public/app/plugins/datasource/prometheus/specs/result_transformer.test.ts
View file @
eccc6adf
...
...
@@ -151,19 +151,19 @@ describe('Prometheus Result Transformer', () => {
target
:
'1'
,
query
:
undefined
,
datapoints
:
[[
10
,
1445000010000
],
[
10
,
1445000020000
],
[
0
,
1445000030000
]],
label
s
:
{
__name__
:
'test'
,
job
:
'testjob'
,
le
:
'1'
},
tag
s
:
{
__name__
:
'test'
,
job
:
'testjob'
,
le
:
'1'
},
},
{
target
:
'2'
,
query
:
undefined
,
datapoints
:
[[
10
,
1445000010000
],
[
0
,
1445000020000
],
[
30
,
1445000030000
]],
label
s
:
{
__name__
:
'test'
,
job
:
'testjob'
,
le
:
'2'
},
tag
s
:
{
__name__
:
'test'
,
job
:
'testjob'
,
le
:
'2'
},
},
{
target
:
'3'
,
query
:
undefined
,
datapoints
:
[[
10
,
1445000010000
],
[
0
,
1445000020000
],
[
10
,
1445000030000
]],
label
s
:
{
__name__
:
'test'
,
job
:
'testjob'
,
le
:
'3'
},
tag
s
:
{
__name__
:
'test'
,
job
:
'testjob'
,
le
:
'3'
},
},
]);
});
...
...
@@ -225,7 +225,7 @@ describe('Prometheus Result Transformer', () => {
target
:
'test{job="testjob"}'
,
query
:
undefined
,
datapoints
:
[[
10
,
0
],
[
10
,
1000
],
[
0
,
2000
]],
label
s
:
{
job
:
'testjob'
},
tag
s
:
{
job
:
'testjob'
},
},
]);
});
...
...
@@ -256,7 +256,7 @@ describe('Prometheus Result Transformer', () => {
target
:
'test{job="testjob"}'
,
query
:
undefined
,
datapoints
:
[[
null
,
0
],
[
10
,
1000
],
[
0
,
2000
]],
label
s
:
{
job
:
'testjob'
},
tag
s
:
{
job
:
'testjob'
},
},
]);
});
...
...
@@ -287,7 +287,7 @@ describe('Prometheus Result Transformer', () => {
target
:
'test{job="testjob"}'
,
query
:
undefined
,
datapoints
:
[[
null
,
0
],
[
null
,
2000
],
[
10
,
4000
],
[
null
,
6000
],
[
10
,
8000
]],
label
s
:
{
job
:
'testjob'
},
tag
s
:
{
job
:
'testjob'
},
},
]);
});
...
...
public/app/plugins/datasource/testdata/datasource.ts
View file @
eccc6adf
...
...
@@ -81,7 +81,12 @@ export class TestDataDataSource extends DataSourceApi<TestDataQuery> {
}
for
(
const
series
of
results
.
series
||
[])
{
data
.
push
({
target
:
series
.
name
,
datapoints
:
series
.
points
,
refId
:
query
.
refId
});
data
.
push
({
target
:
series
.
name
,
datapoints
:
series
.
points
,
refId
:
query
.
refId
,
tags
:
series
.
tags
,
});
}
}
...
...
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