Explorar o código

[prometheus] Use `panelId` and `target.refId` for requestId

Using these two values ties requests to a
particular query position within a panel, ensuring
that requests are canceled if:

- Duplicate requests with the same query are sent
- Requests from the same query position (but a
different query) are sent

The last point is important as it identifies
queries by a physical location in the dashboard
instead of with the query expression.  If a
different query from the same position in a panel
is sent, the previous request should be canceled.
stuart nelson %!s(int64=9) %!d(string=hai) anos
pai
achega
eb35f8cb89
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      public/app/plugins/datasource/prometheus/datasource.ts

+ 1 - 1
public/app/plugins/datasource/prometheus/datasource.ts

@@ -77,7 +77,7 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
 
 
       var query: any = {};
       var query: any = {};
       query.expr = templateSrv.replace(target.expr, options.scopedVars, self.interpolateQueryExpr);
       query.expr = templateSrv.replace(target.expr, options.scopedVars, self.interpolateQueryExpr);
-      query.requestId = target.expr;
+      query.requestId = options.panelId + target.refId;
 
 
       var interval = target.interval || options.interval;
       var interval = target.interval || options.interval;
       var intervalFactor = target.intervalFactor || 1;
       var intervalFactor = target.intervalFactor || 1;