From 960256b574d7b04c281fd4c896e003e0ab210469 Mon Sep 17 00:00:00 2001 From: Dragos Misca Date: Sun, 7 Jul 2024 23:23:48 -0700 Subject: [PATCH] [feat][doc] PIP-264: Update OpenTelemetry deployment documentation (#934) * Clarify OpenTelemetry resource attributes to Prometheus labels relationship * Describe OpenTelemetry memory reuse mode in Pulsar --- docs/deploy-monitoring.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/deploy-monitoring.md b/docs/deploy-monitoring.md index ded3d9c3a783..677a2c7718a0 100644 --- a/docs/deploy-monitoring.md +++ b/docs/deploy-monitoring.md @@ -195,12 +195,7 @@ OTEL_EXPORTER_PROMETHEUS_PORT This endpoint must be accessible by the remote Prometheus scrape server. Note that the exporter is less resource efficient than the OTLP exporter. -Prometheus currently exports the resource attributes in metric `target_info`. In practice, if you have more than one -cluster, it forces you to use PromQL joins to obtain the cluster ID label. - -The Pulsar community has added the option to the OpenTelemetry Java SDK Prometheus Exporter to embed (copy) the cluster -ID label (`pulsar.cluster`) to each outgoing time series labels. Once this is finalized it will be added by default into -Pulsar. +All OpenTelemetry resource attributes are automatically copied to Prometheus labels on each time series. For further configuration details, refer to the exporter [documentation](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#prometheus-exporter). @@ -234,3 +229,11 @@ OpenTelemetry provides an experimental mechanism to control the maximum cardinal limiting the resource usage of the exporter. Pulsar sets the value to 10000 attributes by default. For brokers with a large number of topics, this can prove insufficient. The value is controlled by environment variable `OTEL_EXPERIMENTAL_METRICS_CARDINALITY_LIMIT`. + +#### Memory Reuse Configuration + +OpenTelemetry provides an experimental mechanism to control the reuse of metric attributes. This is particularly useful +for systems with high cardinality metrics, as it reduces the number of memory allocations caused by collector runs. The +mechanism is enabled by default in Pulsar, and can be overridden by environment variable +`OTEL_JAVA_EXPERIMENTAL_EXPORTER_MEMORY_MODE`. For further details and valid configuration values, refer to the +exporter configuration [documentation](https://opentelemetry.io/docs/languages/java/configuration/#exporters).