Skip to content

Commit

Permalink
feat: interpolate receiver query param (#157)
Browse files Browse the repository at this point in the history
This allows for dynamic dashboards where the receiver param is a Grafana
variable.

Co-authored-by: Bert DEFERME <bert.deferme@sfpd.fgov.be>
  • Loading branch information
bdeferme and Bert DEFERME authored Sep 26, 2024
1 parent e2a1a53 commit b2eeb6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export class AlertmanagerDataSource extends DataSourceApi<CustomQuery, GenericOp
params.push(`silenced=${query.silenced ? 'true' : 'false'}`);
params.push(`inhibited=${query.inhibited ? 'true' : 'false'}`);
if (query.receiver !== undefined && query.receiver.length > 0) {
params.push(`receiver=${query.receiver}`);
query.receiver = getTemplateSrv().replace(query.receiver, options.scopedVars, this.interpolateQueryExpr);
params.push(`receiver=${encodeURIComponent(query.receiver)}`);
}
if (query.filters !== undefined && query.filters.length > 0) {
query.filters = getTemplateSrv().replace(query.filters, options.scopedVars, this.interpolateQueryExpr);
Expand Down

0 comments on commit b2eeb6f

Please sign in to comment.