Overview
The OTLP (OpenTelemetry Protocol) HTTP exporter allows you to send traces, metrics, and logs to any OpenTelemetry-compatible backend over HTTP. This is the recommended protocol for production deployments.Dependencies
Add these dependencies to yourCargo.toml:
Cargo.toml
Exporting Traces via HTTP
1
Configure OTLP HTTP Exporter
Set up the OTLP exporter with HTTP transport.
2
Configure Authentication
Add headers for authentication if required by your backend.
3
Use the Tracer
Create and export spans as usual.
Exporting Metrics via HTTP
Exporting Logs via HTTP
Protocol Options
The OTLP HTTP exporter supports two protocols:Common Backend Endpoints
Local OpenTelemetry Collector
Cloud Providers
Most cloud providers require custom endpoints and authentication headers:Configuration via Environment Variables
The OTLP exporter respects standard OpenTelemetry environment variables:When using environment variables, you can create exporters without explicit configuration in code. The SDK will automatically read these values.