From 53eafc8e6088f9f4cef798dbd47b075c163c7f2f Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 15 Dec 2023 13:27:02 -0700 Subject: [PATCH] Prefix Prometheus environment variables with OTEL_CPP --- exporters/prometheus/src/exporter_options.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exporters/prometheus/src/exporter_options.cc b/exporters/prometheus/src/exporter_options.cc index 5d6b17318a..7f64a56413 100644 --- a/exporters/prometheus/src/exporter_options.cc +++ b/exporters/prometheus/src/exporter_options.cc @@ -15,7 +15,7 @@ namespace metrics inline const std::string GetPrometheusDefaultHttpEndpoint() { - constexpr char kPrometheusEndpointEnv[] = "PROMETHEUS_EXPORTER_ENDPOINT"; + constexpr char kPrometheusEndpointEnv[] = "OTEL_CPP_PROMETHEUS_EXPORTER_ENDPOINT"; constexpr char kPrometheusEndpointDefault[] = "localhost:9464"; std::string endpoint; @@ -27,7 +27,8 @@ inline const std::string GetPrometheusDefaultHttpEndpoint() inline bool GetPrometheusPopulateOtelScope() { - constexpr char kPrometheusPopulateOtelScope[] = "PROMETHEUS_EXPORTER_POPULATE_OTEL_SCOPE"; + constexpr char kPrometheusPopulateOtelScope[] = + "OTEL_CPP_PROMETHEUS_EXPORTER_POPULATE_OTEL_SCOPE"; bool setting; auto exists = @@ -38,7 +39,8 @@ inline bool GetPrometheusPopulateOtelScope() inline bool GetPrometheusPopulateTargetInfo() { - constexpr char kPrometheusPopulateTargetInfo[] = "PROMETHEUS_EXPORTER_POPULATE_TARGET_INFO"; + constexpr char kPrometheusPopulateTargetInfo[] = + "OTEL_CPP_PROMETHEUS_EXPORTER_POPULATE_TARGET_INFO"; bool setting; auto exists = opentelemetry::sdk::common::GetBoolEnvironmentVariable(