diff --git a/public/app/plugins/datasource/loki/datasource.ts b/public/app/plugins/datasource/loki/datasource.ts index 3c9c9fbce2d..2d86710a039 100644 --- a/public/app/plugins/datasource/loki/datasource.ts +++ b/public/app/plugins/datasource/loki/datasource.ts @@ -581,7 +581,8 @@ export class LokiDatasource extends DataSourceApi { 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[] = [];