Commit d6ef02b3 by kay delaney Committed by David

Datasource/Loki: Fix issue where annotation queries weren't getting their…

Datasource/Loki: Fix issue where annotation queries weren't getting their variables interpolated (#20702)

Closes #20667
parent 616e2eb2
......@@ -581,7 +581,8 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
return [];
}
const query = { refId: `annotation-${options.annotation.name}`, expr: options.annotation.expr };
const interpolatedExpr = this.templateSrv.replace(options.annotation.expr, {}, this.interpolateQueryExpr);
const query = { refId: `annotation-${options.annotation.name}`, expr: interpolatedExpr };
const { data } = await this.runRangeQueryWithFallback(query, options).toPromise();
const annotations: AnnotationEvent[] = [];
......
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