Skip to main content

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 (opentelemetry crate): Defines interfaces for instrumentation
  • SDK (opentelemetry_sdk crate): Provides implementations of the API for data collection and export

Architecture

OpenTelemetry follows a layered architecture that separates concerns:
This separation allows you to write instrumentation code once using the API, while swapping out different SDK implementations for different environments.

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.
The OpenTelemetry appenders (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:
This pattern allows libraries to instrument their code without requiring dependency injection.

Getting Started

The typical setup flow for OpenTelemetry involves:
  1. Choose an exporter - Determine where you want to send telemetry (stdout, OTLP, Prometheus, etc.)
  2. Configure providers - Set up TracerProvider, MeterProvider, and/or LoggerProvider
  3. Instrument your code - Use the API to create spans, record metrics, and emit logs
  4. 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
The OpenTelemetry Rust ecosystem includes several crates:
  • opentelemetry - Core API
  • opentelemetry_sdk - SDK implementation
  • opentelemetry-otlp - OTLP exporter
  • opentelemetry-stdout - Stdout exporter for debugging
  • opentelemetry-prometheus - Prometheus metrics exporter
  • opentelemetry-zipkin - Zipkin trace exporter
  • opentelemetry-http - HTTP context propagation utilities