Add global metrics labels env var - #6649
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd9b23215b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Reject malformed label configuration before installing recorders so metrics cannot start with silently incomplete global labels. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acd10c7524
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
QW_METRICS_LABELSsupport to inject global labels into metrics keys.name=valuelabel format in the CLI environment variables reference.Why
Global labels let operators tag all Quickwit metrics with deployment context such as environment, region, or cluster without repeating labels at each metric definition.
Example
QW_METRICS_LABELS="environment=production,region=us-east-1" quickwit runThis adds
environment="production"andregion="us-east-1"to all exported metrics regardless the exporter.Test plan
cargo +nightly fmt --all -- --checkcargo test -p quickwit-metricscargo clippy -p quickwit-metrics --all-features --tests -- -D warningsQW_METRICS_LABELS="foo=bar" ./quickwit/target/debug/quickwit run --config config/quickwit.yaml, then verified/metricssamples all includedfoo=\"bar\"