dragosvictor opened a new pull request, #23005: URL: https://github.com/apache/pulsar/pull/23005
[PIP-264](https://github.com/apache/pulsar/blob/master/pip/pip-264.md) ### Motivation The OpenTelemetry collector can be configured to expose the metrics as a Prometheus server, simplifying the deployment and migration of the telemetry pipeline. Pulsar supports this feature out of the box. There is a catch though: the Prometheus exporter did not copy the OpenTelemetry resource attributes over to corresponding Prometheus labels, so vital information was lost in this process. This limitation is described in https://github.com/open-telemetry/opentelemetry-java/issues/6108, which has since been fixed. The present PR leverages this improvement, instructing the OpenTelemetry SDK to migrate _all_ resource attributes over to Prometheus as labels. ### Modifications - During OpenTelemetry SDK initialization in `OpenTelemetryService`, configure any Prometheus exporters to copy all resource attributes as labels. Caveat: At the time this happens, the Prometheus server is already initialized and listening. Reconfiguring it on-the-go is not possible, so the server is closed and recreated with the desired configuration. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change modified tests and can be verified as follows: - Updated integration test `OpenTelemetrySanityTest#testOpenTelemetryMetricsPrometheusExport` to validate the labels are attached to the metrics exposed by the Prometheus exporter. ### Does this pull request potentially affect one of the following parts: - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [x] The metrics: _As described above_ - [ ] Anything that affects deployment ### Documentation - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` https://github.com/apache/pulsar-site/pull/929 - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: https://github.com/dragosvictor/pulsar/pull/38 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
