thanos-io / thanos

Highly available Prometheus setup with long term storage capabilities. A CNCF Incubating project.
https://thanos.io
Apache License 2.0
12.7k stars 2.03k forks source link

Query-frontend: Set value of remote_user field in Slow Query Logs from HTTP header #7363

Closed wndhydrnt closed 1 week ago

wndhydrnt commented 4 weeks ago

Fixes #7360.

Changes

Verification

  1. Build thanos binary locally.
  2. Start Query Frontend component. Point it to an instance of Query. Pass --query-frontend.slow-query-logs-user-header=<test header> and --query-frontend.log-queries-longer-than=1s.
  3. Send request to /api/v1/query that contains a long-running query and sets the <test header>.
wndhydrnt commented 1 week ago

Thanks for the review and the merge.