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

Add toggle to inject the tenant ID to generated metrics #3638

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

Conversation

kvrhdn
Copy link
Member

@kvrhdn kvrhdn commented May 1, 2024

What this PR does:

When a inject_tenant_id_as is set, the Tempo tenant ID is added to all metrics generated by the metrics-generator.
E.g. if set to __tempo_tenant, metrics generated for tenant foo will all have the label __tempo_tenant="foo".

metrics_generator:
  registry:
    inject_tenant_id_as: "__tempo_tenant"

I made the config a string so users can pick a value that doesn't conflict with other labels.

This should make Tempo metrics-generator more useful with a single-tenant metrics backend.

Which issue(s) this PR fixes:
Fixes #3630

Checklist

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

Comment on lines +382 to +383
# If set, the tenant ID will added as label with the given label name to all generated metrics.
[inject_tenant_id_as: <string>]
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll be honest, I didn't really find a nice and concise way to describe this setting. Suggestion are welcome 😅

Also feedback about the name of the setting itself is welcome. It's a bit verbose now imo.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like it 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Even if it's long, it's clear what it does.

Copy link
Contributor

@mdisibio mdisibio left a comment

Choose a reason for hiding this comment

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

Nice feature and lgtm.

Comment on lines +382 to +383
# If set, the tenant ID will added as label with the given label name to all generated metrics.
[inject_tenant_id_as: <string>]
Copy link
Contributor

Choose a reason for hiding this comment

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

I like it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metrics-generator: add option to inject the tenant ID as metrics label
3 participants