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

helm: Log access-policy and token names in GEM query-frontend #9348

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

narqo
Copy link
Contributor

@narqo narqo commented Sep 20, 2024

What this PR does

r308 allows GEM gateway to enable passing the access-policy-name and token-name to mimir backends with the request headers. This enables GEM customers to get a better insight in who is running a query, by logging these headers in the query-frontend query stats. This PR enables updates the Helm chart, enabling this by default.

Below is an example for it looks in the query-frontend logs:

% kubectl -n test-monitoring logs deployments/mmr-mimir-query-frontend
...
ts=2024-09-20T10:17:03.035087976Z caller=handler.go:383 level=info
user=tenant-1 
msg="query stats" component=query-frontend 
method=GET path=/prometheus/api/v1/query 
route_name=prometheus_api_v1_query 
user_agent=curl/8.7.1 
status_code=200 
···
header_x_access_policy_name=test-access-policy-1 
header_x_token_name=test-access-policy-1-token-1 
status=success

That is, in addition to the user=tenant-1 that query-frontend logs already, we now log the following:

  • header_x_access_policy_name=test-access-policy-1 — the access policy name
  • header_x_token_name=test-access-policy-1-token-1 — the full token name

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@narqo narqo requested a review from a team as a code owner September 20, 2024 10:38
Signed-off-by: Vladimir Varankin <[email protected]>
@narqo narqo force-pushed the vldmr/helm-r308-pass-gem-access-policy branch from a2a9ef9 to dd713ee Compare September 20, 2024 10:38
Signed-off-by: Vladimir Varankin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant