Commit ee84d437 by Mitsuhiro Tanda

fix prometheus annotation, reflect API change

parent f8b05e0f
......@@ -162,11 +162,17 @@ describe('PrometheusDatasource', function() {
var urlExpected = 'proxied/api/v1/query_range?query=' +
encodeURIComponent('ALERTS{alertstate="firing"}') +
'&start=1443438675&end=1443460275&step=60s';
var annotation = {
expr: 'ALERTS{alertstate="firing"}',
tagKeys: 'job',
titleFormat: '{{alertname}}',
textFormat: '{{instance}}'
var options = {
annotation: {
expr: 'ALERTS{alertstate="firing"}',
tagKeys: 'job',
titleFormat: '{{alertname}}',
textFormat: '{{instance}}'
},
range: {
from: moment(1443438674760),
to: moment(1443460274760)
}
};
var response = {
status: "success",
......@@ -180,7 +186,7 @@ describe('PrometheusDatasource', function() {
};
beforeEach(function() {
ctx.$httpBackend.expect('GET', urlExpected).respond(response);
ctx.ds.annotationQuery(annotation, {from: moment(1443438674760), to: moment(1443460274760)}).then(function(data) { results = data; });
ctx.ds.annotationQuery(options).then(function(data) { results = data; });
ctx.$httpBackend.flush();
});
it('should return annotation list', function() {
......
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