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

Allow use of instance and job labels #277

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Conversation

Sinjo
Copy link
Member

@Sinjo Sinjo commented Feb 14, 2023

These labels were previously reserved under all circumstances, but Prometheus server handles them just fine in the metric data it scrapes.

The reason we'd reserved them is that Prometheus automatically generates values for them when it scrapes a target, and we didn't want to cause a collision. It turns out Prometheus handles that collision just fine.

By default, Prometheus server will prepend exported_ to them if they're present in the scraped data (i.e. exported_instance and exported_job). Users can set honor_labels in their Prometheus server config if they prefer the labels from the scraped metric data to take precedence over the labels generated by the server.

Signed-off-by: Chris Sinjakli chris@sinjakli.co.uk


Fixes #275

@Sinjo Sinjo requested a review from dmagliola February 14, 2023 16:43
These labels were previously reserved under all circumstances, but
Prometheus server handles them just fine in the metric data it scrapes.

The reason we'd reserved them is that Prometheus automatically generates
values for them when it scrapes a target, and we didn't want to cause a
collision. It turns out Prometheus handles that collision just fine.

By default, Prometheus server will prepend `exported_` to them if
they're present in the scraped data (i.e. `exported_instance` and
`exported_job`). Users can set `honor_labels` in their Prometheus server
config if they prefer the labels from the scraped metric data to take
precedence over the labels generated by the server.

Signed-off-by: Chris Sinjakli <chris@sinjakli.co.uk>
@Sinjo Sinjo force-pushed the sinjo-loosen-reserved-labels branch from d251b83 to e53f7ed Compare February 14, 2023 18:06
Copy link
Collaborator

@dmagliola dmagliola left a comment

Choose a reason for hiding this comment

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

Nice! Thank you!

@Sinjo Sinjo merged commit db756a1 into main Feb 15, 2023
@Sinjo Sinjo deleted the sinjo-loosen-reserved-labels branch February 15, 2023 11:02
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.

pushing metrics with instance grouping_key would result: instance is reserved
2 participants