Skip to content

Commit

Permalink
Prefix Prometheus environment variables with OTEL_CPP
Browse files Browse the repository at this point in the history
  • Loading branch information
timwoj committed Dec 15, 2023
1 parent fe7eca7 commit 53eafc8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions exporters/prometheus/src/exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 =
Expand All @@ -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(
Expand Down

0 comments on commit 53eafc8

Please sign in to comment.