Skip to content

Commit a1266cc

Browse files
authored
[ENH]: allow overriding metrics endpoint with standard OTEL_EXPORTER_OTLP_METRICS_ENDPOINT if set (#4248)
## Description of changes `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` is a standard environment variable used by [OTLP SDKs](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter). This updates our metric exporter set up so that this value is properly consumed if set. ## Test plan *How are these changes tested?* - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes *Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?* n/a
1 parent bb13a4e commit a1266cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: rust/tracing/src/init_tracer.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ pub fn init_otel_layer(
9191
// Prepare meter.
9292
let metric_exporter = opentelemetry_otlp::MetricExporter::builder()
9393
.with_tonic()
94-
.with_endpoint(otel_endpoint)
94+
.with_endpoint(
95+
std::env::var("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT").unwrap_or(otel_endpoint.clone()),
96+
)
9597
.build()
9698
.expect("could not build metric exporter");
9799

0 commit comments

Comments
 (0)