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

Prometheus exporter reports reader not registered on startup #3291

Closed
MrAlias opened this issue Oct 14, 2022 · 2 comments · Fixed by #3342
Closed

Prometheus exporter reports reader not registered on startup #3291

MrAlias opened this issue Oct 14, 2022 · 2 comments · Fixed by #3342
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics bug Something isn't working pkg:exporter:prometheus Related to the Prometheus exporter package

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Oct 14, 2022

Description

Running the Prometheus exporter example results in the following error being logged:

reader is not registered

Environment

  • Go Version: 1.19
  • opentelemetry-go version: b6a22ab

Steps To Reproduce

  1. Checkout commit
  2. cd example/prometheus
  3. go run .
  4. See error:
2022/10/14 13:23:14 reader is not registered
2022/10/14 13:23:14 serving metrics at localhost:2223/metrics

Expected behavior

The line 2022/10/14 13:23:14 reader is not registered should not be logged.

@MrAlias MrAlias added bug Something isn't working area:metrics Part of OpenTelemetry Metrics pkg:exporter:prometheus Related to the Prometheus exporter package labels Oct 14, 2022
@MrAlias MrAlias added this to the Metric v0.33.0 milestone Oct 14, 2022
@MrAlias
Copy link
Contributor Author

MrAlias commented Oct 14, 2022

My guess is this error is returned by the underlying manualReader when the collector is registered. Likely because Describe is being called then and the exporter has not been registered with any MeterProvider.

Maybe this registration needs to be delayed?

@MadVikingGod
Copy link
Contributor

After reading more details about the prometheus collector interface I think we should do nothing on Describe. This is called when the collector is registered with prometheus, and is intended to produce the names of the metrics that we will send prometheus. Because we won't know these until later, we should be using the unchecked collector mode of prometheus, by returning nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics bug Something isn't working pkg:exporter:prometheus Related to the Prometheus exporter package
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants