[receiver/prometheusremotewritereceiver] accept unspecified histogram#43901
[receiver/prometheusremotewritereceiver] accept unspecified histogram#43901jelly-afk wants to merge 3 commits into
Conversation
dashpole
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
Do you mean other metric types besides histograms? 🤔
If so, those were handled in #42295
|
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 <perebaj@gmail.com> Co-authored-by: Vihas Makwana <121151420+VihasMakwana@users.noreply.github.com> Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
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.