Skip to content

Commit

Permalink
fix custom headers not added to loki output http/s requests
Browse files Browse the repository at this point in the history
Signed-off-by: Linus Roepert <[email protected]>
  • Loading branch information
lsroe authored and poiana committed Jan 29, 2025
1 parent 58ec197 commit 4a634b0
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 @@ -665,6 +665,16 @@ func getConfig() *types.Configuration {
}
}

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

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

0 comments on commit 4a634b0

Please sign in to comment.