Skip to content

Commit 09b8401

Browse files
committed
Merge pull request grafana#3624 from mtanda/prometheus_link_fix
(prometheus) fix Prometheus link
2 parents 03c10ef + ebf0bd5 commit 09b8401

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

public/app/plugins/datasource/prometheus/query_ctrl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function (angular, _) {
77

88
var module = angular.module('grafana.controllers');
99

10-
module.controller('PrometheusQueryCtrl', function($scope) {
10+
module.controller('PrometheusQueryCtrl', function($scope, templateSrv) {
1111

1212
$scope.init = function() {
1313
var target = $scope.target;
@@ -46,9 +46,9 @@ function (angular, _) {
4646

4747
$scope.linkToPrometheus = function() {
4848
var range = Math.ceil(($scope.range.to.valueOf() - $scope.range.from.valueOf()) / 1000);
49-
var endTime = $scope.range.to.utc().format('YYYY-MM-DD HH:MM');
49+
var endTime = $scope.range.to.utc().format('YYYY-MM-DD HH:mm');
5050
var expr = {
51-
expr: $scope.target.expr,
51+
expr: templateSrv.replace($scope.target.expr, $scope.panel.scopedVars),
5252
range_input: range + 's',
5353
end_input: endTime,
5454
step_input: '',

0 commit comments

Comments
 (0)