Prometheus receiver does not collect _bucket and _sum when explicitly mentioned in scraping config #36060
Labels
bug
Something isn't working
needs triage
New item requiring triage
receiver/prometheus
Prometheus receiver
Component(s)
receiver/prometheus
What happened?
Description
We want to use OTEL for metrics collection in our Kubernetes environmet and then forward them to Prometheus. For this case we use Prometehus receiver and prometheusremotewrite. We found, that Prometheus receiver is not able to scrape some metrics when they are explicitly mentioned in the scraping config, e.g.:
Receiver is able to scrape them, when wildcard regex is used, e.g.:
On the other side, we are able to scrape metrics:
When they are explicitly mentioned in scrpaing config.
Prometheus Agent (another tool we have comparison to) is able to scrape all the mentioned metrics without any issue (both wth exact name or with wildcard config).
Steps to Reproduce
First of all... These metrics exist within the cluster (output truncated):
When I use the following config:
I don't see any output in debug log from collector:
Also no metrics are available through Grafana.
When I change the config to a wildcard (truncated):
I can see this output in collector pod logs:
And all the metrics in Grafana.
My conclusion
The following metrics can be scraped directly by name:
Following metrics are collected only if wildcard is used for the metrics
These wildcards work correctly and returns all the expected metrics:
Expected Result
Be able to collect all the metrics explicitely mentioned in scraping config.
Actual Result
Prometheus receiver is able to scrape all expected metrics when using regex wildcard, but not when the exact name is used.
Collector version
0.112.0-amd
Environment information
Environment
Kubernetes 1.29, 1.30
OpenTelemetry Collector configuration
Log output
Additional context
Moved from open-telemetry/opentelemetry-collector#11533 to this repo.
I did a few more tests with these metrics and its collection.
The OTEL config is the same like mentioned above. The only change is the regex in the matrics scraping configuration:
Especially case 7 where is scraping set for 2 metrics, but 3 metrics are scraped... I tried several times to change it to something different (which produced different outputs) and then back to the number 7 and it always led to the same 3 metrics even if the scraping was set for 2.
@Aneurysm9, @dashpole, do you please have any idea?
Thank you
The text was updated successfully, but these errors were encountered: