Skip to content

Add global metrics labels env var - #6649

Merged
Mallets merged 5 commits into
mainfrom
mallets/env-labels
Aug 3, 2026
Merged

Add global metrics labels env var#6649
Mallets merged 5 commits into
mainfrom
mallets/env-labels

Conversation

@Mallets

@Mallets Mallets commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add QW_METRICS_LABELS support to inject global labels into metrics keys.
  • Document the name=value label 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 run

This adds environment="production" and region="us-east-1" to all exported metrics regardless the exporter.

Test plan

  • cargo +nightly fmt --all -- --check
  • cargo test -p quickwit-metrics
  • cargo clippy -p quickwit-metrics --all-features --tests -- -D warnings
  • Manual check: QW_METRICS_LABELS="foo=bar" ./quickwit/target/debug/quickwit run --config config/quickwit.yaml, then verified /metrics samples all included foo=\"bar\"

Mallets and others added 4 commits August 3, 2026 09:58
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>
@Mallets
Mallets marked this pull request as ready for review August 3, 2026 08:39
@Mallets
Mallets requested a review from a team as a code owner August 3, 2026 08:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread quickwit/quickwit-metrics/src/inner.rs
Comment thread quickwit/quickwit-metrics/src/inner.rs Outdated
Comment thread docs/reference/cli.md Outdated
Reject malformed label configuration before installing recorders so metrics cannot start with silently incomplete global labels.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Mallets
Mallets requested a review from a team as a code owner August 3, 2026 10:07
@Mallets
Mallets enabled auto-merge (squash) August 3, 2026 10:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread quickwit/quickwit-metrics/src/lib.rs
@Mallets
Mallets merged commit f49ce1e into main Aug 3, 2026
9 checks passed
@Mallets
Mallets deleted the mallets/env-labels branch August 3, 2026 10:19
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.

2 participants