Skip to content
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

Add more detailed error message when initPrometheusComponent failed #33828

Closed
chenlujjj opened this issue Jul 1, 2024 · 5 comments
Closed

Add more detailed error message when initPrometheusComponent failed #33828

chenlujjj opened this issue Jul 1, 2024 · 5 comments
Labels
needs triage New item requiring triage receiver/prometheus Prometheus receiver

Comments

@chenlujjj
Copy link
Contributor

Component(s)

receiver/prometheus

Describe the issue you're reporting

We encountered the following problem when using prometheus receiver to scrape metrics from pods:
image

The error message didn't provide enough information of why it failed. Actually it is caused by the prometheus discovery library which doesn’t expose the low-level error why Register fails. Wondering any ways to improve the error to make debug easier.

@chenlujjj chenlujjj added the needs triage New item requiring triage label Jul 1, 2024
@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Jul 1, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

crobert-1 commented Jul 1, 2024

It looks like the error itself is frequency of #32123, @chenlujjj can you share what version of the collector and Prometheus you're using?

It would be good to confirm you're hitting this before the underlying issue was fixed, in addition to adding more detailed error messaging.

@chenlujjj
Copy link
Contributor Author

Hi @crobert-1 , we are using splunk-otel-collector v0.97.0, and the prometheus library it depends is github.com/prometheus/prometheus v0.50.1.

The receiver configuration is:

receiver_creator/application:
    receivers:
      prometheus_simple/app_pods:
        rule: type == "port" && pod.annotations["prometheus.io/scrape"] == "true" && ( string(port) == pod.annotations["prometheus.io/port"] || name == pod.annotations["prometheus.io/port"] )
        config:
          endpoint: "`endpoint`"
          metrics_path: '`"prometheus.io/path" in pod.annotations ? pod.annotations["prometheus.io/path"] : "/metrics"`'
          collection_interval: '`"prometheus.io/collection_interval" in pod.annotations ? pod.annotations["prometheus.io/collection_interval"] : "30s"`'

@chenlujjj
Copy link
Contributor Author

After restarting collector process, the issue was gone temporarily

@dashpole
Copy link
Contributor

dashpole commented Jul 8, 2024

This is fixed by #32202 in version v0.98.0 of the collector

@dashpole dashpole closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage New item requiring triage receiver/prometheus Prometheus receiver
Projects
None yet
Development

No branches or pull requests

3 participants