Skip to content

Commit

Permalink
feat(alertmanager): add custom headers to alert manager
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Donnelly <[email protected]>
  • Loading branch information
Umaaz authored and poiana committed Apr 5, 2024
1 parent 145e780 commit c0d12a3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,16 @@ func getConfig() *types.Configuration {
c.Alertmanager.DropEventThresholds = value
}

if value, present := os.LookupEnv("ALERTMANAGER_CUSTOMHEADERS"); present {
customheaders := strings.Split(value, ",")
for _, label := range customheaders {
tagkeys := strings.Split(label, ":")
if len(tagkeys) == 2 {
c.Alertmanager.CustomHeaders[tagkeys[0]] = tagkeys[1]
}
}
}

if value, present := os.LookupEnv("GCP_PUBSUB_CUSTOMATTRIBUTES"); present {
customattributes := strings.Split(value, ",")
for _, label := range customattributes {
Expand Down

0 comments on commit c0d12a3

Please sign in to comment.