SDK Metrics

Some SDK components can emit telemetry about their internal state according to the semantic conventions for OpenTelemetry SDK metrics. At the time of writing these semantic conventions are still in development and in order to have them exported you need to set the OTEL_PYTHON_SDK_INTERNAL_METRICS_ENABLED environment variable to true.

The provided sdk_metrics.py example shows how to setup manually the SDK in order to send them.

Installation

pip install -r requirements.txt

Run the Example

Start an OTLP HTTP collector or compatible backend listening on the default endpoint, http://localhost:4318. To use a different endpoint, configure OTEL_EXPORTER_OTLP_ENDPOINT or the signal-specific OTLP exporter environment variables.

python sdk_metrics.py

The example sends a span, a log record, and the OpenTelemetry SDK health metrics emitted by the configured SDK components.