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

Detect name collisions around _bucket, _count, _sum, and the quantile label during Gathering of metrics #108

Closed
beorn7 opened this issue Apr 13, 2015 · 3 comments
Assignees
Milestone

Comments

@beorn7
Copy link
Member

beorn7 commented Apr 13, 2015

Summaries and histograms implicitly create time series named xxx_count and xxx_sum. In addition, histograms implicitly create time series named xxx_bucket. While this should not strictly be a concern of the client (in principle, a future version of the Prometheus server could treat summaries and histograms as 1st class types that do not get dissected into a number of series with the names described above), we should nevertheless avoid name collisions. Thus:

Once a summary or histogram named xxx is registered, any metric named xxx_count, xxx_sum, or xxx_bucket (in case of histograms) must be rejected (and vice versa).

@beorn7 beorn7 self-assigned this Apr 13, 2015
@beorn7 beorn7 added this to the v0.9 milestone Aug 19, 2016
@juliusv
Copy link
Member

juliusv commented Apr 25, 2017

A user on IRC just ran into this (via different sources pushing metrics to the StatsD exporter).

@beorn7
Copy link
Member Author

beorn7 commented Jul 9, 2018

Currently, the Desc doesn't contain the metric type (for a reason, but that would take too long to explain, and the relevance of that reason has decreased a lot over time). Thus, we cannot detect those collisions during registration time (unless we want to ban all metrics ending on _count, _sum, and _bucket).

With the changes planned for v0.10 (i.e. #222 ), a registration check as described above will be possible.

Thus, my plan for v0.9 is to detect the collisions during scrape time (and therefore not expose something that a current Prometheus server cannot ingest). In v0.10, those collisions will be detected during registration time.

Also, we can right now prevent labels called quantile in summaries with quantiles (simply on instantiation time of a Summary type, I think this is a fair reason to panic).

I will rename this issue accordingly and create a separate one for the v0.10 part.

@beorn7 beorn7 changed the title Prevent name collisions around _bucket, _count, _sum. Detect name collisions around _bucket, _count, _sum, and the quantile label during Gathering of metrics Jul 9, 2018
@beorn7
Copy link
Member Author

beorn7 commented Jul 9, 2018

While this should not strictly be a concern of the client (in principle, a future version of the Prometheus server could treat summaries and histograms as 1st class types that do not get dissected into a number of series with the names described above), we should nevertheless avoid name collisions.

Ha, here you can see my wishful thinking more than three years ago. Now we have the flattening even in the only exposition format the server understands…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants