loki
loki copied to clipboard
feat(lambda-promtail): Add possibility to set additional HTTP headers for promtail-client requests
What this PR does / why we need it:
This PR adds the ability to set additional, custom HTTP headers for requests made by the promtail client in the lambda-promtail
tool. Additional headers can be passed to the AWS Lambda function via the environment variable EXTRA_HTTP_HEADERS
in the form <HTTP header 1 key>,<HTTP header 1 value>,<HTTP header 2 key>,<HTTP header 2 value>, ...
.
This functionality is needed when for example requests pass a AWS Web Application Firewall that expects a certain custom header to be set on every request passed to a load balancer. If this load balancer must be traversed to access the Loki gateway push endpoint, then there is currently no easy way to achieve this.
Special notes for your reviewer:
Simple header key validation was implemented using regex, but there is currently no validation for header values.
@cstyan would you be able to review this PR?
@trc-ikeskin IMO there's still some minor changes we should make here
@trc-ikeskin did you still want to proceed with this PR?
@trc-ikeskin did you still want to proceed with this PR?
@cstyan I still want to continue eventually but I cannot find the time right now - sorry.
@trc-ikeskin did you still want to proceed with this PR?
@cstyan I still want to continue eventually but I cannot find the time right now - sorry.
:+1: no worries