From be48caf59f891138699786c7431b799b838adbc7 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Thu, 31 Dec 2015 15:47:42 +0900 Subject: [PATCH] fix Prometheus link, expand template variable in expression --- public/app/plugins/datasource/prometheus/query_ctrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/query_ctrl.js b/public/app/plugins/datasource/prometheus/query_ctrl.js index bbbaff4aa56..0b0377bf81b 100644 --- a/public/app/plugins/datasource/prometheus/query_ctrl.js +++ b/public/app/plugins/datasource/prometheus/query_ctrl.js @@ -7,7 +7,7 @@ function (angular, _) { var module = angular.module('grafana.controllers'); - module.controller('PrometheusQueryCtrl', function($scope) { + module.controller('PrometheusQueryCtrl', function($scope, templateSrv) { $scope.init = function() { var target = $scope.target; @@ -48,7 +48,7 @@ function (angular, _) { 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 expr = { - expr: $scope.target.expr, + expr: templateSrv.replace($scope.target.expr, $scope.panel.scopedVars), range_input: range + 's', end_input: endTime, step_input: '',