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
7bc15ec6
Commit
7bc15ec6
authored
May 13, 2016
by
Utkarsh Bhatnagar
Committed by
Torkel Ödegaard
May 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bug Fix] Opentsdb Alias issue (#4910)
* Fixed Opentsdb Alias issue * Fixed Opentsdb query editor
parent
e5021157
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
public/app/plugins/datasource/opentsdb/config_ctrl.ts
+2
-1
public/app/plugins/datasource/opentsdb/datasource.js
+9
-3
public/app/plugins/datasource/opentsdb/partials/query.editor.html
+3
-3
No files found.
public/app/plugins/datasource/opentsdb/config_ctrl.ts
View file @
7bc15ec6
...
@@ -16,7 +16,8 @@ export class OpenTsConfigCtrl {
...
@@ -16,7 +16,8 @@ export class OpenTsConfigCtrl {
tsdbVersions
=
[
tsdbVersions
=
[
{
name
:
'<=2.1'
,
value
:
1
},
{
name
:
'<=2.1'
,
value
:
1
},
{
name
:
'>=2.2'
,
value
:
2
},
{
name
:
'==2.2'
,
value
:
2
},
{
name
:
'==2.3'
,
value
:
3
},
];
];
tsdbResolutions
=
[
tsdbResolutions
=
[
...
...
public/app/plugins/datasource/opentsdb/datasource.js
View file @
7bc15ec6
...
@@ -54,13 +54,12 @@ function (angular, _, dateMath) {
...
@@ -54,13 +54,12 @@ function (angular, _, dateMath) {
});
});
return
this
.
performTimeSeriesQuery
(
queries
,
start
,
end
).
then
(
function
(
response
)
{
return
this
.
performTimeSeriesQuery
(
queries
,
start
,
end
).
then
(
function
(
response
)
{
var
metricToTargetMapping
=
mapMetricsToTargets
(
response
.
data
,
options
);
var
metricToTargetMapping
=
mapMetricsToTargets
(
response
.
data
,
options
,
this
.
tsdbVersion
);
var
result
=
_
.
map
(
response
.
data
,
function
(
metricData
,
index
)
{
var
result
=
_
.
map
(
response
.
data
,
function
(
metricData
,
index
)
{
index
=
metricToTargetMapping
[
index
];
index
=
metricToTargetMapping
[
index
];
if
(
index
===
-
1
)
{
if
(
index
===
-
1
)
{
index
=
0
;
index
=
0
;
}
}
this
.
_saveTagKeys
(
metricData
);
this
.
_saveTagKeys
(
metricData
);
return
transformMetricData
(
metricData
,
groupByTags
,
options
.
targets
[
index
],
options
,
this
.
tsdbResolution
);
return
transformMetricData
(
metricData
,
groupByTags
,
options
.
targets
[
index
],
options
,
this
.
tsdbResolution
);
...
@@ -114,6 +113,9 @@ function (angular, _, dateMath) {
...
@@ -114,6 +113,9 @@ function (angular, _, dateMath) {
msResolution
:
msResolution
,
msResolution
:
msResolution
,
globalAnnotations
:
true
globalAnnotations
:
true
};
};
if
(
this
.
tsdbVersion
===
3
)
{
reqBody
.
showQuery
=
true
;
}
// Relative queries (e.g. last hour) don't include an end time
// Relative queries (e.g. last hour) don't include an end time
if
(
end
)
{
if
(
end
)
{
...
@@ -393,9 +395,12 @@ function (angular, _, dateMath) {
...
@@ -393,9 +395,12 @@ function (angular, _, dateMath) {
return
query
;
return
query
;
}
}
function
mapMetricsToTargets
(
metrics
,
options
)
{
function
mapMetricsToTargets
(
metrics
,
options
,
tsdbVersion
)
{
var
interpolatedTagValue
;
var
interpolatedTagValue
;
return
_
.
map
(
metrics
,
function
(
metricData
)
{
return
_
.
map
(
metrics
,
function
(
metricData
)
{
if
(
tsdbVersion
===
3
)
{
return
metricData
.
query
.
index
;
}
else
{
return
_
.
findIndex
(
options
.
targets
,
function
(
target
)
{
return
_
.
findIndex
(
options
.
targets
,
function
(
target
)
{
if
(
target
.
filters
&&
target
.
filters
.
length
>
0
)
{
if
(
target
.
filters
&&
target
.
filters
.
length
>
0
)
{
return
target
.
metric
===
metricData
.
metric
&&
return
target
.
metric
===
metricData
.
metric
&&
...
@@ -410,6 +415,7 @@ function (angular, _, dateMath) {
...
@@ -410,6 +415,7 @@ function (angular, _, dateMath) {
});
});
}
}
});
});
}
});
});
}
}
...
...
public/app/plugins/datasource/opentsdb/partials/query.editor.html
View file @
7bc15ec6
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
</div>
</div>
</div>
</div>
<div
class=
"gf-form"
ng-if=
"ctrl.tsdbVersion
=
= 2"
>
<div
class=
"gf-form"
ng-if=
"ctrl.tsdbVersion
>
= 2"
>
<label
class=
"gf-form-label query-keyword width-6"
>
Fill
</label>
<label
class=
"gf-form-label query-keyword width-6"
>
Fill
</label>
<div
class=
"gf-form-select-wrapper"
>
<div
class=
"gf-form-select-wrapper"
>
<select
ng-model=
"ctrl.target.downsampleFillPolicy"
class=
"gf-form-input"
<select
ng-model=
"ctrl.target.downsampleFillPolicy"
class=
"gf-form-input"
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
</div>
</div>
</div>
</div>
<div
class=
"gf-form-inline"
ng-if=
"ctrl.tsdbVersion
=
= 2"
>
<div
class=
"gf-form-inline"
ng-if=
"ctrl.tsdbVersion
>
= 2"
>
<div
class=
"gf-form"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label query-keyword width-8"
>
<label
class=
"gf-form-label query-keyword width-8"
>
...
@@ -170,7 +170,7 @@
...
@@ -170,7 +170,7 @@
<div
class=
"gf-form"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label query-keyword width-8"
>
<label
class=
"gf-form-label query-keyword width-8"
>
Tags
Tags
<info-popover
mode=
"right-normal"
ng-if=
"ctrl.tsdbVersion
=
= 2"
>
<info-popover
mode=
"right-normal"
ng-if=
"ctrl.tsdbVersion
>
= 2"
>
Please use filters, tags are deprecated in opentsdb 2.2
Please use filters, tags are deprecated in opentsdb 2.2
</info-popover>
</info-popover>
</label>
</label>
...
...
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