Skip to content

Conversation

beorn7
Copy link
Member

@beorn7 beorn7 commented Sep 30, 2025

Fixes #430.

@beorn7 beorn7 requested a review from krajorama September 30, 2025 18:46
for _, b := range metric.Histogram.Bucket {
if b.GetCumulativeCountFloat() > 0 {
return written, fmt.Errorf(
"float histogram %s %s not supported in OpenMetrics",
Copy link
Member

Choose a reason for hiding this comment

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

Let's be a bit more generic to be consistent with other errors and avoid having to say OpenMetrics version as well.

Suggested change
"float histogram %s %s not supported in OpenMetrics",
"unexpected float histogram bucket count in metric %s %s",

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if that nails it. The float histogram is not necessarily unexpected. It's fine in the data model, just that OM v1 cannot represent it.

We could say "current format does not support float histogram bucket count in metric %s %s" or maybe "OpenMetrics v1.0 does not support float histogram bucket count in metric %s %s". WDYT?

}
if metric.Histogram.GetSampleCountFloat() > 0 {
return written, fmt.Errorf(
"float histogram %s %s not supported in OpenMetrics",
Copy link
Member

Choose a reason for hiding this comment

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

Let's be a bit more generic to be consistent with other errors and avoid having to say OpenMetrics version as well.

Suggested change
"float histogram %s %s not supported in OpenMetrics",
"unexpected float histogram count in metric %s %s",

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.

expfmt: need to support gauge histogram metric type and float histogram
2 participants