Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loki output does not contain custom headers defined via env variable #1108

Closed
lsroe opened this issue Jan 29, 2025 · 1 comment · Fixed by #1107
Closed

Loki output does not contain custom headers defined via env variable #1108

lsroe opened this issue Jan 29, 2025 · 1 comment · Fixed by #1107
Labels
kind/bug Something isn't working
Milestone

Comments

@lsroe
Copy link
Contributor

lsroe commented Jan 29, 2025

Describe the bug

Custom headers for the Loki output set via LOKI_CUSTOMHEADERS headers are not added to the http/s requests.

How to reproduce it

Verify via GODEBUG=http2debug=2 and LOKI_CUSTOMHEADERS="Header: Token 1234" on falcosidekick side (header not added):

2025/01/29 10:32:15 http2: Transport encoding header ":authority" = "localhost:9988"
2025/01/29 10:32:15 http2: Transport encoding header ":method" = "POST"
2025/01/29 10:32:15 http2: Transport encoding header ":path" = "/loki/api/v1/push"
2025/01/29 10:32:15 http2: Transport encoding header ":scheme" = "https"
2025/01/29 10:32:15 http2: Transport encoding header "content-type" = "application/json"
2025/01/29 10:32:15 http2: Transport encoding header "user-agent" = "Falcosidekick"
2025/01/29 10:32:15 http2: Transport encoding header "content-length" = "290"
2025/01/29 10:32:15 http2: Transport encoding header "accept-encoding" = "gzip"
2025/01/29 10:32:15 http2: Framer 0xc000916000: wrote HEADERS flags=END_HEADERS stream=1 len=63

And on (Loki) server side:

--------------------Header------------------------
Content-Type        : [application/json]
User-Agent          : [Falcosidekick]
Content-Length      : [290]
Accept-Encoding     : [gzip]
-------------------------------------------------

Expected behaviour

Expected behaviour using Fix: #1107

2025/01/29 10:37:59 http2: Transport encoding header ":authority" = "localhost:9988"
2025/01/29 10:37:59 http2: Transport encoding header ":method" = "POST"
2025/01/29 10:37:59 http2: Transport encoding header ":path" = "/loki/api/v1/push"
2025/01/29 10:37:59 http2: Transport encoding header ":scheme" = "https"
2025/01/29 10:37:59 http2: Transport encoding header "user-agent" = "Falcosidekick"
2025/01/29 10:37:59 http2: Transport encoding header "header" = " Token 1234"
2025/01/29 10:37:59 http2: Transport encoding header "content-type" = "application/json"
2025/01/29 10:37:59 http2: Transport encoding header "content-length" = "290"
2025/01/29 10:37:59 http2: Transport encoding header "accept-encoding" = "gzip"
2025/01/29 10:37:59 http2: Framer 0xc00097c000: wrote HEADERS flags=END_HEADERS stream=1 len=79

Server side:

--------------------Header------------------------
User-Agent          : [Falcosidekick]
Header              : [ Token 1234]
Content-Type        : [application/json]
Content-Length      : [290]
Accept-Encoding     : [gzip]
-------------------------------------------------

Screenshots

Environment

Build from source at 58ec197423ddd5ab51c5049f854c67dfad424dfa

  • Falco version:
  • System info:
  • Cloud provider or hardware configuration:
  • OS:
  • Kernel:
  • Installation method:

Additional context

@Issif
Copy link
Member

Issif commented Jan 29, 2025

Nice catch, thank you for the PR too.

@github-project-automation github-project-automation bot moved this from To do to Done in Falcosidekick 2.x Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants