loki icon indicating copy to clipboard operation
loki copied to clipboard

feat(lambda-promtail): Add possibility to set additional HTTP headers for promtail-client requests

Open trc-ikeskin opened this issue 1 year ago • 3 comments

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.

trc-ikeskin avatar Feb 06 '24 19:02 trc-ikeskin

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 06 '24 19:02 CLAassistant

@cstyan would you be able to review this PR?

trc-ikeskin avatar Feb 07 '24 08:02 trc-ikeskin

@trc-ikeskin IMO there's still some minor changes we should make here

cstyan avatar Apr 22 '24 23:04 cstyan

@trc-ikeskin did you still want to proceed with this PR?

cstyan avatar Jul 16 '24 22:07 cstyan

@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 avatar Jul 17 '24 07:07 trc-ikeskin

@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

cstyan avatar Jul 17 '24 20:07 cstyan