Prometheus Release 9.0 Causes a Port Binding Error When Using the Prometheus Exporter
Is your feature request related to a problem?
Yes. Currently, the OpenTelemetry CPP repo uses the latest release, version 9.0, of the CPP Prometheus client. However, using this release will throw an exception when trying to use the Prometheus Exporter. The exception reads libc++abi.dylib: terminating with uncaught exception of type CivetException: null context when constructing CivetServer. Possible problem binding to port.
Describe the solution you'd like Until a new release is established, we instead should use the master branch of the CPP Prometheus client. Though this means we won’t be using a stable version, the Prometheus Exporter would work properly and when a newer version is released, that could be the new version to use.
Describe alternatives you've considered Alternatively, we can keep using version 9.0 and wait for a new version of the Prometheus client to be released. This allows the Prometheus Exporter to be dependent on a stable release; however, the Prometheus Exporter would not work, and a new release may not come soon.
This can be done by removing git checkout v0.9.0 in line 52 of ./ci/do_ci.sh.
This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.
This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.
Closed as inactive. Feel free to reopen if this is still an issue.
This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.
The port number to use for the prometheus scrape is configurable.
With the following fix:
- https://github.com/open-telemetry/opentelemetry-cpp/pull/1396
the documentation to use prometheus has been expanded, and provides details.
When an instrumented process exposes a scrape port, 9464 by default, or as set in:
- environment variable
PROMETHEUS_EXPORTER_ENDPOINT -
PrometheusExporterOptions::url
the port must be available, so the process can bind to it.
Closing this issue, it is now resolved.