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

Change label name for metrics generator instance #1439

Merged
merged 4 commits into from
May 23, 2022

Conversation

joe-elliott
Copy link
Member

@joe-elliott joe-elliott commented May 23, 2022

What this PR does:
The metrics generators add an instance label to distinguish between metrics series. This prevents out of order issues with remote write. Unfortunately instance is a very common label name and may conflict with custom dimensions on service graphs or span metrics.

This PR proposes a much more unique label name that is far less likely to conflict __metrics_gen_instance. Feel free to suggest other options if desired.

Checklist

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

@joe-elliott joe-elliott marked this pull request as ready for review May 23, 2022 16:03
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Copy link
Member

@yvrhdn yvrhdn left a comment

Choose a reason for hiding this comment

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

Back when I added the instance label I was trying to figure out what would be most appropriate. The only guidance I found about this was:

Label names may contain ASCII letters, numbers, as well as underscores. They must match the regex [a-zA-Z_][a-zA-Z0-9_]*. Label names beginning with __ are reserved for internal use.

https://prometheus.io/docs/concepts/data_model/

So this technically isn't allowed, but tbh I think this document is mostly aimed towards clients that are scraped by Prometheus?
An internal label conflicting with __metrics_gen_instance seems very unlikely.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Koenraad Verheyden <[email protected]>
@joe-elliott joe-elliott merged commit 8cd7dc7 into grafana:main May 23, 2022
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