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
fc189132
Commit
fc189132
authored
May 18, 2016
by
Mitsuhiro Tanda
Committed by
Torkel Ödegaard
May 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(prometheus) fix prometheus link (#5074)
parent
8a9455d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
public/app/plugins/datasource/prometheus/datasource.ts
+4
-4
public/app/plugins/datasource/prometheus/query_ctrl.ts
+1
-1
No files found.
public/app/plugins/datasource/prometheus/datasource.ts
View file @
fc189132
...
...
@@ -43,7 +43,7 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
return
value
.
replace
(
/
[\\
^$*+?.()|[
\]
{}
]
/g
,
'
\\\\
$&'
);
}
function
interpolateQueryExpr
(
value
,
variable
,
defaultFormatFn
)
{
this
.
interpolateQueryExpr
=
function
(
value
,
variable
,
defaultFormatFn
)
{
// if no multi or include all do not regexEscape
if
(
!
variable
.
multi
&&
!
variable
.
includeAll
)
{
return
value
;
...
...
@@ -59,6 +59,7 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
// Called once per panel (graph)
this
.
query
=
function
(
options
)
{
var
self
=
this
;
var
start
=
getPrometheusTime
(
options
.
range
.
from
,
false
);
var
end
=
getPrometheusTime
(
options
.
range
.
to
,
true
);
...
...
@@ -73,7 +74,7 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
activeTargets
.
push
(
target
);
var
query
:
any
=
{};
query
.
expr
=
templateSrv
.
replace
(
target
.
expr
,
options
.
scopedVars
,
interpolateQueryExpr
);
query
.
expr
=
templateSrv
.
replace
(
target
.
expr
,
options
.
scopedVars
,
self
.
interpolateQueryExpr
);
var
interval
=
target
.
interval
||
options
.
interval
;
var
intervalFactor
=
target
.
intervalFactor
||
1
;
...
...
@@ -99,7 +100,6 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
return
this
.
performTimeSeriesQuery
(
query
,
start
,
end
);
},
this
));
var
self
=
this
;
return
$q
.
all
(
allQueryPromise
)
.
then
(
function
(
allResponse
)
{
var
result
=
[];
...
...
@@ -160,7 +160,7 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
var
interpolated
;
try
{
interpolated
=
templateSrv
.
replace
(
expr
,
{},
interpolateQueryExpr
);
interpolated
=
templateSrv
.
replace
(
expr
,
{},
this
.
interpolateQueryExpr
);
}
catch
(
err
)
{
return
$q
.
reject
(
err
);
}
...
...
public/app/plugins/datasource/prometheus/query_ctrl.ts
View file @
fc189132
...
...
@@ -61,7 +61,7 @@ class PrometheusQueryCtrl extends QueryCtrl {
var
rangeDiff
=
Math
.
ceil
((
range
.
to
.
valueOf
()
-
range
.
from
.
valueOf
())
/
1000
);
var
endTime
=
range
.
to
.
utc
().
format
(
'YYYY-MM-DD HH:mm'
);
var
expr
=
{
expr
:
this
.
templateSrv
.
replace
(
this
.
target
.
expr
,
this
.
panelCtrl
.
panel
.
scopedVars
),
expr
:
this
.
templateSrv
.
replace
(
this
.
target
.
expr
,
this
.
panelCtrl
.
panel
.
scopedVars
,
this
.
datasource
.
interpolateQueryExpr
),
range_input
:
rangeDiff
+
's'
,
end_input
:
endTime
,
step_input
:
''
,
...
...
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