Skip to main content

otel_metrics_enabled

Function otel_metrics_enabled 

Source
pub fn otel_metrics_enabled() -> bool
Expand description

Returns a boolean indicating if the OTEL metrics layer should be enabled.

It is considered enabled if any of the following environment variables are set and not empty:

  • OTEL_EXPORTER_OTLP_ENDPOINT
  • OTEL_EXPORTER_OTLP_METRICS_ENDPOINT

Note that this is overridden if OTEL_SDK_DISABLED is set and not empty.