-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Prometheus receiver does not scrape some Summary type metrics #1638
Comments
This is a bug in the prometheus receiver, see #1255 |
I don't think the file exporter does not work, it exports the entire data as json, are you sure you receive the data? |
Yes, the logging exporter shows the histogram and summary metrics but I see them as DoubleDataPoints
|
That is not a histogram or summary it is a double data point. |
Please add the logs. |
@bogdandrutu Sorry for the late response, it took me some time to debug. Both the logging exporter and file exporter is not able to export some summary type metrics, specially the _sum type My config file
With the same config I launched a prometheus server which is able to scrape the metric. I think this is issue of promethues receiver, which is not able to scrape apiserver_admission_step_admission_duration_seconds_summary_sum metric. I am not sure of the reason why This is specially interesting as apiserver_admission_step_admission_duration_seconds_summary is scrapped by the receiver and exported properly. Am I missing something? |
I think I get it now, the _sum and _count metrics are summarized in the same metric https://github.com/open-telemetry/opentelemetry-collector/blob/master/receiver/prometheusreceiver/internal/metricfamily.go#L157. Out of curiosity Is there a specific reason to do that rather than leaving the metric as it is. ex we get apiserver_admission_step_admission_duration_seconds_summary_sum as a separate metric. |
There is also a similar issue. I have a metric named X(gauge) and X_count(counter). Both metric have different set of labels. Due to the logic https://github.com/open-telemetry/opentelemetry-collector/blob/master/receiver/prometheusreceiver/internal/metricsbuilder.go#L199 they get merged in a single metric of gauge type(union of labels from both X and X_count), though the data points are not lost but it would require to custom logic to extract individual ones. Can we make this trimming optional? A boolean flag which will be default true and we can set it false for not trimming suffix. I would also like to know the reasoning behind trimming suffixes. Is there some major drawback if we keep the suffix |
I've run into this and think the issue is that summary types aren't supported by the internal pdata types: https://github.com/open-telemetry/opentelemetry-collector/blob/master/translator/internaldata/oc_to_metrics.go#L227. @bogdandrutu is there an inherent limitation to this or could support be added relatively easily? I'd be happy to take a crack at it if immediately feasible. edit: this comment may apply primarily to #1255 |
One proposal for Summary can be found here: |
_Note:_ This PR is based off the Summary datapoint proto (that has not been merged upstream) in this [PR](https://github.com/open-telemetry/opentelemetry-proto/pull/227/files). **Description:** This PR has two main parts: * Implement the [Summary datapoint proto](https://github.com/open-telemetry/opentelemetry-proto/pull/227/files) in the OTel Collector. Changes were made to _metrics_struct.go_ to create the generated Summary structs (using the `make genproto` and `make genpdata` commands). * Add in the conversion between OpenCensus summary metrics and OTel Summary datapoints. This conversion directly adds compatibility for the Prometheus Summary metric in the PrometheusReceiver. **Link to tracking Issue:** [opentelemetry-specification/issues/1146](open-telemetry/opentelemetry-specification#1146) and [opentelemetry-collector/issues/1638](#1638) A lot of the code in this PR is auto-generated from creating the structs and protos. The following files are were auto-generated: * generated_metrics.go * generated_metrics_test.go * trace_config.pb.go * metrics.pg.go **Testing:** * Updated unit tests in _oc_to_metrics.go_ for conversion between OC summary metrics to OTel summary metrics * Created end-to-end tests for the Summary metric in PrometheusReceiver
@tigrannajaryan Would you be able to assign this to me? Thank you! |
* Unexport the simple and batch SpanProcessors * Update changes in changelog
…can break metrics for Kubernetes pods and containers, pinning this receiver's version to v0.51.0 (open-telemetry#1638)
Describe the bug
A clear and concise description of what the bug is.
Steps to reproduce
If possible, provide a recipe for reproducing the error.
What did you expect to see?
I have a Prometheus receiver + file exporter + logging exporter config. I expect to see all gauge, histogram and summary metric in the json file from file exporter.
What did you see instead?
I can only see Gauge metrics, some of histogram and summary in the json file from fileexporter and logging exporter.
Specifically _sum, _count for summary metrics are not available
The Prometheus receiver translates counter, histogram, and summary metrics into OTLP metrics with non-cumulative temporality.
Is this the expected behavior with Promethues receiver? If so do I need modify/add a new fileexporter or the receiver to handle this scenario?
What version did you use?
otel/opentelemetry-collector-dev:latest@sha256:ceebae71600ece5b280f7b4f74e7dfde8670761cf84b5c2a5f17089e8db31be0
What config did you use?
Environment
NA
Additional context
My metrics are exposed in prometheus format, so I am left with the choice of using prometheus receiver. The above config works for a prometheus server. So the metric is available.
cc @huyan0 @alolita @jmacd @bogdandrutu
The text was updated successfully, but these errors were encountered: