-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[receiver/prometheusremotewritereceiver] accept unspecified histogram #43901
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
[receiver/prometheusremotewritereceiver] accept unspecified histogram #43901
Conversation
dashpole
left a comment
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.
This will only work for CBNH, not standard "split" histograms (e.g. with _bucket _sum and _count series). Will this actually fix your use-case? I'm very surprised that you can get a CBNH without a histogram type...
I think that's the common case when Prometheus doesn't have |
| }(), | ||
| }, | ||
| { | ||
| name: "unspecified histogram", |
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.
Could you add one extra test that has Native histograms with custom buckets? Those are the histograms with schema == -53, you'll probably find examples in other tests in this same file
| if ts.Metadata.Type == writev2.Metadata_METRIC_TYPE_HISTOGRAM { | ||
| histMetric.Metadata().PutStr(prometheus.MetricMetadataTypeKey, "histogram") | ||
| } else { | ||
| histMetric.Metadata().PutStr(prometheus.MetricMetadataTypeKey, "unknown") | ||
| } |
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.
Isn't better to use switch case for this use case?
| if ts.Metadata.Type == writev2.Metadata_METRIC_TYPE_HISTOGRAM || | ||
| ts.Metadata.Type == writev2.Metadata_METRIC_TYPE_UNSPECIFIED && len(ts.Histograms) > 0 { |
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.
Can we receive a Metadata_METRIC_TYPE_UNSPECIFIED with other type of time series, different than Histograms? Or this is an impossible scenario?
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.
Do you mean other metric types besides histograms? 🤔
If so, those were handled in #42295
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.
you are right. thanks!
|
Thanks for that @jelly-afk. Just 2 nits. |
Hi, I don't have similar use case. I opened this because I worked on the first part of the issue. |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Fixed a concurrency bug in the Prometheus remote write receiver where concurrent requests with identical job/instance labels would return empty responses after the first successful request. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> Fixes open-telemetry#42159 <!--Describe what testing was performed and which tests were added.--> <!--Describe the documentation added.--> <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: perebaj <[email protected]> Co-authored-by: Vihas Makwana <[email protected]> Co-authored-by: Arthur Silva Sens <[email protected]>
afe1b57 to
53bed3e
Compare
|
sorry, i will open a new one |
Description
prometheusremote write receiver now accepts histogram with unspecified metric type.
Link to tracking issue
Fixes #41840
Testing
Added a testcase in
TestTranslateV2test function to test unspecified histogram.