Commit 7edc95cc by Mitsuhiro Tanda Committed by Carl Bergquist

(cloudwatch) fix cloudwatch query error over 24h (#9536)

fix cloudwatch query error over 24h
parent 2d840f12
...@@ -41,7 +41,7 @@ function (angular, _, moment, dateMath, kbn, templatingVariable) { ...@@ -41,7 +41,7 @@ function (angular, _, moment, dateMath, kbn, templatingVariable) {
item.namespace = templateSrv.replace(item.namespace, options.scopedVars); item.namespace = templateSrv.replace(item.namespace, options.scopedVars);
item.metricName = templateSrv.replace(item.metricName, options.scopedVars); item.metricName = templateSrv.replace(item.metricName, options.scopedVars);
item.dimensions = self.convertDimensionFormat(item.dimensions, options.scopeVars); item.dimensions = self.convertDimensionFormat(item.dimensions, options.scopeVars);
item.period = self.getPeriod(item, options); item.period = String(self.getPeriod(item, options)); // use string format for period in graph query, and alerting
return _.extend({ return _.extend({
refId: item.refId, refId: item.refId,
......
...@@ -37,7 +37,7 @@ describe('CloudWatchDatasource', function() { ...@@ -37,7 +37,7 @@ describe('CloudWatchDatasource', function() {
InstanceId: 'i-12345678' InstanceId: 'i-12345678'
}, },
statistics: ['Average'], statistics: ['Average'],
period: 300 period: '300'
} }
] ]
}; };
...@@ -109,7 +109,7 @@ describe('CloudWatchDatasource', function() { ...@@ -109,7 +109,7 @@ describe('CloudWatchDatasource', function() {
ctx.ds.query(query).then(function() { ctx.ds.query(query).then(function() {
var params = requestParams.queries[0]; var params = requestParams.queries[0];
expect(params.period).to.be(600); expect(params.period).to.be('600');
done(); done();
}); });
ctx.$rootScope.$apply(); ctx.$rootScope.$apply();
......
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