Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanburgess committed Feb 5, 2024
1 parent 7c38a8c commit 7487101
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mixin-utils/utils.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@ local g = import 'grafana-builder/grafana.libsonnet';
// withRunbookURL - Add/Override the runbook_url annotations for all alerts inside a list of rule groups.
// - url_format: an URL format for the runbook, the alert name will be substituted in the URL.
// - groups: the list of rule groups containing alerts.
withRunbookURL(url_format, groups, internal=false)::
// - annotation_key: the key to use for the annotation whose value will be the formatted runbook URL.
withRunbookURL(url_format, groups, annotation_key='runbook_url')::
local update_rule(rule) =
if std.objectHas(rule, 'alert')
then rule {
annotations+: {
[if !internal then 'runbook_url' else 'internal_runbook_url']: url_format % rule.alert,
[annotation_key]: url_format % rule.alert,
},
}
else rule;
Expand Down

0 comments on commit 7487101

Please sign in to comment.