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

Merged
merged 1 commit into from
May 28, 2024

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 +388
# 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 +388
# 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 👍

@knylander-grafana knylander-grafana added the type/docs Improvements or additions to documentation label May 14, 2024
Copy link
Contributor

@knylander-grafana knylander-grafana left a comment

Choose a reason for hiding this comment

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

Approving for text and doc updates.

Copy link
Contributor

This PR must be merged before a backport PR will be created.

@kvrhdn kvrhdn force-pushed the kvrhdn/metrics-generator-inject-tenant branch from 08ab162 to 12ab9b7 Compare May 28, 2024 15:45
@kvrhdn
Copy link
Member Author

kvrhdn commented May 28, 2024

Squashing so backport action can cherry pick the commit

@kvrhdn kvrhdn merged commit 6206fcd into grafana:main May 28, 2024
15 checks passed
github-actions bot pushed a commit that referenced this pull request May 28, 2024
@kvrhdn kvrhdn deleted the kvrhdn/metrics-generator-inject-tenant branch May 28, 2024 16:36
kvrhdn added a commit that referenced this pull request May 29, 2024
(cherry picked from commit 6206fcd)

Co-authored-by: Koenraad Verheyden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-v2.5 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
4 participants