Commit be48caf5 by Mitsuhiro Tanda

fix Prometheus link, expand template variable in expression

parent c0cf0cb8
...@@ -7,7 +7,7 @@ function (angular, _) { ...@@ -7,7 +7,7 @@ function (angular, _) {
var module = angular.module('grafana.controllers'); var module = angular.module('grafana.controllers');
module.controller('PrometheusQueryCtrl', function($scope) { module.controller('PrometheusQueryCtrl', function($scope, templateSrv) {
$scope.init = function() { $scope.init = function() {
var target = $scope.target; var target = $scope.target;
...@@ -48,7 +48,7 @@ function (angular, _) { ...@@ -48,7 +48,7 @@ function (angular, _) {
var range = Math.ceil(($scope.range.to.valueOf() - $scope.range.from.valueOf()) / 1000); var range = Math.ceil(($scope.range.to.valueOf() - $scope.range.from.valueOf()) / 1000);
var endTime = $scope.range.to.utc().format('YYYY-MM-DD HH:MM'); var endTime = $scope.range.to.utc().format('YYYY-MM-DD HH:MM');
var expr = { var expr = {
expr: $scope.target.expr, expr: templateSrv.replace($scope.target.expr, $scope.panel.scopedVars),
range_input: range + 's', range_input: range + 's',
end_input: endTime, end_input: endTime,
step_input: '', step_input: '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment