-
Notifications
You must be signed in to change notification settings - Fork 213
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
prom-to-sd: Prefer proto in content type #739
Conversation
a998b5f
to
8fcca67
Compare
cc @leonzz to have a review as well |
/lgtm |
@@ -375,6 +377,11 @@ func convertToDistributionValue(h *dto.Histogram) *v3.Distribution { | |||
prevVal = b.GetCumulativeCount() | |||
} | |||
|
|||
// +Inf Bucket is implicit so it needs to be added | |||
if !infSeen && count > int64(prevVal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this is addressing a different issue, could you add some background in the PR description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a different issue because the +inf bucket is omitted in protobuf encoding but text encoding handles that specially (see https://github.com/prometheus/common/blob/main/expfmt/text_create.go#L232 if interested). However, it makes sense to separate the changes with description, for which I split the changes into 2 commits to make it clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM-)
Prometheus allows optional +Inf bucket and adds it in text encoding (see https://github.com/prometheus/common/blob/main/expfmt/text_create.go#L232). Google cloud monitoring requires +Inf explicitly if there are any data point in +Inf bucket. So we need to add +Inf bucket in conversion when needed.
Also add support for multiple response formats (text/proto)
Will merge. Have discussed offline that the release flow will be expected. |
Also add support for multiple response formats (text/proto)