pub fn get_protocol() -> Protocol
Expand description
Determines the OpenTelemetry protocol to use based on the OTEL_EXPORTER_OTLP_PROTOCOL environment variable.
§Returns
A Protocol
enum value indicating which protocol format to use:
Protocol::HttpBinary
if OTEL_EXPORTER_OTLP_PROTOCOL is set to “http/protobuf”Protocol::HttpJson
if OTEL_EXPORTER_OTLP_PROTOCOL is set to “http/json” or empty/unset
§Environment Variables
OTEL_EXPORTER_OTLP_PROTOCOL
: The protocol format to use. Supported values are:- “http/protobuf” - Use Protocol Buffers over HTTP
- “http/json” - Use JSON over HTTP (default)
If an unsupported protocol value is provided, defaults to HTTP JSON with a warning message.