Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ local teamConfig = getTeamConfig(environment, team);
local importedResource = std.parseJson(std.extVar('ALERT_CONFIGS'));

// Get config from team
local folderUid = teamConfig.folderUid;
local contactPoint = teamConfig.contactPoint;

// Create Grizzly AlertRuleGroup using alert template
[
alertTemplate.createAlertRuleGroup(
title=alertGroup.name,
folderUid=folderUid,
folderUid= if std.objectHas(alertGroup, 'folderUid') && alertGroup.folderUid != null then alertGroup.folderUid else teamConfig.folderUid,
alertRules= alertGroup.alertRules,
interval=alertGroup.interval,
teamConfig=teamConfig
Expand Down
2 changes: 1 addition & 1 deletion teams/stage/devops/web-server/alerts.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local alertGroups = [
{
name: 'per5MinuteEval',
interval: 300,
folderUid: 'beu35l1zpl7uoa',
alertRules: [
{
title: "Web Server High Response Time - Stage",
Expand Down Expand Up @@ -36,7 +37,6 @@ local alertGroups = [
t, service
ORDER BY t
|||,
folderUid: 'beybgvo5u3i0wb'
},
]
}
Expand Down
2 changes: 1 addition & 1 deletion templates/alert-rule-template.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ local createAlertRuleGroup(title, folderUid, alertRules, interval=300, teamConfi
keepFiringFor: if std.objectHas(rule, 'keepFiringFor') && rule.keepFiringFor != null then rule.keepFiringFor else defaultEvalConfig.keepFiringFor,
annotations: rule.annotations,
labels: if std.objectHas(teamConfig, 'labels') && teamConfig.labels != null then teamConfig.labels else {} + if std.objectHas(rule, 'labels') && rule.labels != null then rule.labels else {},
folderUID: if std.objectHas(rule, 'folderUid') && rule.folderUid != null then rule.folderUid else teamConfig.folderUid,
folderUID: folderUid,
notification_settings: {
receiver: if std.objectHas(rule, 'contactPoint') && rule.contactPoint != null
then rule.contactPoint
Expand Down