Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make hidden runbook_url annotations visible #217

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions component/rules.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,18 @@ local patchRules = {
function(group)
group {
rules: std.map(
function(rule) alertpatching.patchRule(rule, rulePatches, false) {
expr: patchExpr(super.expr),
},
function(rule)
alertpatching.patchRule(rule, rulePatches, false) {
// NOTE(sg): Make runbook_url annotation visible so we can
// always patch it. This is necessary because some upstream
// Jsonnet hides the annotation with `runbook_url::` for
// alerts where they don't want to set the annotation.
annotations+:
if std.objectHasAll(rule.annotations, 'runbook_url') then {
runbook_url::: super.runbook_url,
} else {},
expr: patchExpr(super.expr),
} + { annotations: std.prune(super.annotations) },
group.rules
),
},
Expand Down
Loading