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

histogram: Find a way of marking a Native Histograms without observations as such #1127

Closed
beorn7 opened this issue Sep 6, 2022 · 2 comments · Fixed by #1314
Closed

histogram: Find a way of marking a Native Histograms without observations as such #1127

beorn7 opened this issue Sep 6, 2022 · 2 comments · Fixed by #1314
Assignees

Comments

@beorn7
Copy link
Member

beorn7 commented Sep 6, 2022

It is a good thing if the format can expose the conventional and the native version of a histogram side by side. But if a native histogram has a zero threshold of zero and zero observations yet, it might easily look like it’s not a native histogram at all, so Prometheus might ingest it assuming it’s a conventional histogram, which gets weird once it has actually received observations and Prometheus starts to ingest it as a native histogram. See code for details.

This is P2 as explained in the milestone's description.

@beorn7 beorn7 added this to the Native Histograms milestone Sep 6, 2022
@beorn7
Copy link
Member Author

beorn7 commented Oct 11, 2022

How about we require to add a no-op span (length zero) in this case? Those spans are legal, and will be compacted away, but we could use them as the ultimate marker for a native histogram (just for the special case of a histogram without any observations yet and a zero threshold of zero).

Thoughts @codesome @fstab ?

@beorn7 beorn7 self-assigned this Oct 11, 2022
@codesome
Copy link
Member

And empty span seems like the least bad way to do it.

beorn7 added a commit that referenced this issue Jul 20, 2023
Fixes #1127.

If a native histogram has no observations and a zero threshold of
zero, then it is indistinguishable from a classic histogram. To give
scrapers a hint that it is indeed a native histogram, we add a no-op
span.

This needs follow-up PRs in prometheus/prometheus and
prometheus/client_model.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this issue Jul 20, 2023
Fixes #1127.

If a native histogram has no observations and a zero threshold of
zero, then it is indistinguishable from a classic histogram. To give
scrapers a hint that it is indeed a native histogram, we add a no-op
span.

This needs follow-up PRs in prometheus/prometheus and
prometheus/client_model.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit to prometheus/client_model that referenced this issue Jul 20, 2023
See prometheus/client_golang#1127 for details.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit to prometheus/prometheus that referenced this issue Jul 20, 2023
Native histograms without observations and with a zero threshold of
zero look the same as classic histograms in the protobuf exposition
format. According to
prometheus/client_golang#1127 , the idea is
to add a no-op span to those histograms to mark them as native
histograms. This commit enables Prometheus to detect that no-op span
and adds a doc comment to the proto spec describing the behavior.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit to prometheus/prometheus that referenced this issue Jul 20, 2023
Native histograms without observations and with a zero threshold of
zero look the same as classic histograms in the protobuf exposition
format. According to
prometheus/client_golang#1127 , the idea is
to add a no-op span to those histograms to mark them as native
histograms. This commit enables Prometheus to detect that no-op span
and adds a doc comment to the proto spec describing the behavior.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit to prometheus/client_model that referenced this issue Jul 20, 2023
See prometheus/client_golang#1127 for details.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit to prometheus/prometheus that referenced this issue Jul 20, 2023
Native histograms without observations and with a zero threshold of
zero look the same as classic histograms in the protobuf exposition
format. According to
prometheus/client_golang#1127 , the idea is
to add a no-op span to those histograms to mark them as native
histograms. This commit enables Prometheus to detect that no-op span
and adds a doc comment to the proto spec describing the behavior.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit to prometheus/prometheus that referenced this issue Jul 26, 2023
Native histograms without observations and with a zero threshold of
zero look the same as classic histograms in the protobuf exposition
format. According to
prometheus/client_golang#1127 , the idea is
to add a no-op span to those histograms to mark them as native
histograms. This commit enables Prometheus to detect that no-op span
and adds a doc comment to the proto spec describing the behavior.

Signed-off-by: beorn7 <beorn@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants