|
|
@@ -21,10 +21,11 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
|
|
|
this.withCredentials = instanceSettings.withCredentials;
|
|
|
this.lastErrors = {};
|
|
|
|
|
|
- this._request = function(method, url) {
|
|
|
+ this._request = function(method, url, cacheKey) {
|
|
|
var options: any = {
|
|
|
url: this.url + url,
|
|
|
- method: method
|
|
|
+ method: method,
|
|
|
+ cacheKey: cacheKey
|
|
|
};
|
|
|
|
|
|
if (this.basicAuth || this.withCredentials) {
|
|
|
@@ -122,7 +123,7 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
|
|
|
|
|
|
this.performTimeSeriesQuery = function(query, start, end) {
|
|
|
var url = '/api/v1/query_range?query=' + encodeURIComponent(query.expr) + '&start=' + start + '&end=' + end + '&step=' + query.step;
|
|
|
- return this._request('GET', url);
|
|
|
+ return this._request('GET', url, query.expr.toString());
|
|
|
};
|
|
|
|
|
|
this.performSuggestQuery = function(query) {
|