What is OpenTelemetry?
OpenTelemetry is a vendor-neutral observability framework for cloud-native software. It provides a collection of APIs, SDKs, and tools to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior. The OpenTelemetry Rust implementation consists of two main components:- API (
opentelemetrycrate): Defines interfaces for instrumentation - SDK (
opentelemetry_sdkcrate): Provides implementations of the API for data collection and export
Architecture
OpenTelemetry follows a layered architecture that separates concerns:Three Pillars of Observability
OpenTelemetry provides three types of telemetry signals:Traces
Traces track the progression of requests as they flow through distributed systems. Each trace is composed of spans representing individual operations.Metrics
Metrics provide quantitative measurements about your service. OpenTelemetry supports various instrument types for different measurement patterns.Logs
The logs API provides a bridge between existing logging libraries and OpenTelemetry. It’s not intended to be called directly by application developers.opentelemetry-appender-log and opentelemetry-appender-tracing) bridge these logs to the OpenTelemetry ecosystem.
Global Providers
OpenTelemetry uses global provider singletons to make telemetry available throughout your application:Getting Started
The typical setup flow for OpenTelemetry involves:- Choose an exporter - Determine where you want to send telemetry (stdout, OTLP, Prometheus, etc.)
- Configure providers - Set up TracerProvider, MeterProvider, and/or LoggerProvider
- Instrument your code - Use the API to create spans, record metrics, and emit logs
- Export telemetry - Configure how and when data is sent to your observability backend
Next Steps
Signals
Deep dive into traces, metrics, and logs
Resources
Learn about resource detection and attributes
Context Propagation
Understand how context flows across services
Quick Start
Start instrumenting your application
Related Crates
The OpenTelemetry Rust ecosystem includes several crates:opentelemetry- Core APIopentelemetry_sdk- SDK implementationopentelemetry-otlp- OTLP exporteropentelemetry-stdout- Stdout exporter for debuggingopentelemetry-prometheus- Prometheus metrics exporteropentelemetry-zipkin- Zipkin trace exporteropentelemetry-http- HTTP context propagation utilities