NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #427 most downloaded on crates.io
OpenTelemetry API for Rust
Last release 19 days ago
18 Sep 2026
Release timing varies
gaps range from 2 weeks to 8 months
Nearly every release is documented
notes for 42 of 43 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
43 releases · first in 2019
See the 0.33.0 release notes and migration guidance .
See the 0.33.0 release notes and migration guidance.
The OTLP exporters for Logs and Metrics remain release candidates. We plan to declare them stable in 0.33.1 after approximately two weeks of validation, provided no issues requiring breaking API changes arise. The Logs and Metrics API and SDK remain stable; Distributed Tracing remains pre-stable.
First release of opentelemetry-propagator-b3, providing B3 trace context propagation for OpenTelemetry Rust.
Based on the B3 implementation in opentelemetry-zipkin, with the existing API and behavior. B3 users can migrate their dependency and imports to opentelemetry_propagator_b3::{B3Encoding, Propagator}.
Released 2026-Sep-18
TraceState accepting more than the 32 list-members the W3C trace-context
specification allows. from_str, from_key_value and insert now keep at most
32, dropping members from the end of the list as the specification prescribes, so
neither a parsed nor a locally built tracestate can exceed the limit.ContextObserver can be registered via GlobalContextObserver::set to be
notified of context transitions through the on_context_enter and
on_context_exit callbacks. This feature is primarily intended to publish a
different view of the current context (the ObserverContextView) through
alternative channels that let external readers (e.g. an eBPF profiler) track
the current context. See the associated
OTEP.
Gated behind the experimental_context_observer feature flag.otel_info!, otel_warn!, otel_debug!, and otel_error! macros now accept quoted-key fields
(e.g. "otel.component.type" = "value") for dotted attribute names.BoundGauge<T> and BoundUpDownCounter<T> types (and the
corresponding Gauge::bind() / UpDownCounter::bind() methods), completing
the experimental bound-instrument API across all sync instruments
(Counter, UpDownCounter, Histogram, Gauge). Gated behind the
experimental_metrics_bound_instruments feature flag.Context::with_value() calls
Context::current() from its Drop implementation.One column per quarter.
Added BoundCounter and BoundHistogram types that cache resolved aggregator references for a fixed attribute set. Created via Counter::bind() and Histo
Released 2026-May-08
BoundCounter<T> and BoundHistogram<T> types that cache resolved
aggregator references for a fixed attribute set. Created via Counter::bind()
and Histogram::bind(), bound instruments bypass per-call attribute lookup,
providing significant performance improvements for hot paths where the same
attributes are used repeatedly. Both types implement Clone so a single bound
state can be shared across threads or modules without re-binding. Also adds
the SyncInstrument::bind() trait method and BoundSyncInstrument<T> trait
for SDK implementors; the trait method has a no-op default so custom
SyncInstrument impls degrade gracefully without panicking. Gated behind the
experimental_metrics_bound_instruments feature flag.reserve method to opentelemetry::propagation::Injector to hint at the number of elements that will be added to avoid multiple resize operations of the underlying data structure. Has an empty default implementation.SpanBuilder #3227:
trace_id, span_id, end_time, status, sampling_resultwith_trace_id, with_span_id, with_end_time, with_status, with_sampling_result#[must_use] attribute to opentelemetry::metrics::AsyncInstrumentBuilder to add compile time warning when .build() is not called on observable instrument builders, preventing silent failures where callbacks are never registered and metrics are never reported.opentelemetry::trace to opentelemetry_sdk::trace #3277:
SamplingDecision, SamplingResultopentelemetry_sdk::trace instead.tracing events emitted via the internal-logs featureContext::current() from Drop implementations triggered by ContextGuard cleanup (#3262).*Breaking* Change return type of opentelemetry::set_tracer_provider to Unit to align with metrics counterpart
Released 2025-Sep-25
opentelemetry::global::set_tracer_provider to Unit to align with metrics counterpartget_all method to opentelemetry::propagation::Extractor to return all values of the given propagation key and provide a default implementation.IntoIterator implementation for opentelemetry::trace::TraceState to allow iterating through its key-value pair collection.is_telemetry_suppressed() - Checks if telemetry is suppressed in this context
Released 2025-May-23
#2821 Context based suppression capabilities added: Added the ability to prevent recursive telemetry generation through new context-based suppression mechanisms. This feature helps prevent feedback loops and excessive telemetry when OpenTelemetry components perform their own operations.
New methods added to Context:
is_telemetry_suppressed() - Checks if telemetry is suppressed in this
contextwith_telemetry_suppressed() - Creates a new context with telemetry
suppression enabledis_current_telemetry_suppressed() - Efficiently checks if the current thread's context
has telemetry suppressedenter_telemetry_suppressed_scope() - Convenience method to enter a scope where telemetry is
suppressedThese methods allow SDK components, exporters, and processors to temporarily disable telemetry generation during their internal operations, ensuring more predictable and efficient observability pipelines.
tracing for internal-logs feature to remove the need of adding tracing as a dependencyBug Fix: Re-export WithContext at opentelemetry::context::WithContext #2879 to restore backwards compatibility
Release 2025-Apr-01
WithContext at opentelemetry::trace::context::WithContext #2879 to restore backwards compatibility
WithContext and FutureExt are in opentelemetry::context as they are independent of the trace signal. Users should prefer this path.Breaking changes for baggage users: #2717
Released 2025-Mar-21
ExportError trait from opentelemetry::trace::ExportError to opentelemetry_sdk::export::ExportErrorTraceError enum from opentelemetry::trace::TraceError to opentelemetry_sdk::trace::TraceErrorTraceResult type alias from opentelemetry::trace::TraceResult to opentelemetry_sdk::trace::TraceResultInstrumentationScope implementation for PartialEq and Hash fixed to include Attributes also.Baggage from Value to StringValueBaggage constants to reflect latest standard (MAX_KEY_VALUE_PAIRS - 180 -> 64, MAX_BYTES_FOR_ONE_PAIR - removed) and increased insert performance see #2284.Baggage.remove() signature with .get() to take the key as a referenceBaggage can't be retrieved from the Context directly anymore and needs to be accessed via context.baggage()with_baggage() and current_with_baggage() override any existing Baggage in the ContextBaggage keys can't be empty and only allow ASCII visual chars, except "(),/:;<=>?@[\]{} (see RFC7230, Section 3.2.6)KeyValueMetadata does not publicly expose its fields. This should be transparent change to the users.Context to use a stack to properly handle out of order dropping of ContextGuard. This imposes a limit of 65535 nested contexts on a single thread. See #2378 and #1887.name: Option<&str> parameter to the event_enabled method
on the Logger trait. This allows implementations (SDK, processor, exporters)
to leverage this additional information to determine if an event is enabled.Breaking opentelemetry::shutdown_tracer_provider() Removed from this crate, should now use tracer_provider.shutdown() see #2369 for a migration exampl
Released 2025-Feb-10
opentelemetry::global::shutdown_tracer_provider() Removed from this crate, should now use tracer_provider.shutdown() see #2369 for a migration example.opentelemetry::PropagationError struct.Released 2025-Feb-10
Released 2024-Nov-27
Released 2024-Nov-27
Breaking change for exporter authors: Marked KeyValue related structs and enums as non_exhaustive. #2228
Released 2024-Nov-11
LogRecord::set_trace_context; an optional method conditional on the trace feature for setting trace context on a log record.as_any from AsyncInstrument trait and the implementing instruments: ObservableCounter, ObservableGauge, and ObservableUpDownCounter #2187SyncInstrument trait to replace the individual synchronous instrument traits (SyncCounter, SyncGauge, SyncHistogram, SyncUpDownCounter) which are meant for SDK implementation. #2207observe method on asynchronous instruments can only be called inside a callback. This was done by removing the implementation of AsyncInstrument trait for each of the asynchronous instruments. #2210PartialOrd and Ord implementations for KeyValue. #2215KeyValue related structs and enums as non_exhaustive. #2228AnyValue enum as non_exhaustive. #2230init method used to create instruments has been renamed to build. Also, try_init() method is removed from instrument builders. The return types of InstrumentProvider trait methods modified to return the instrument struct, instead of Result. #2227Before:
let counter = meter.u64_counter("my_counter").init();
Now:
let counter = meter.u64_counter("my_counter").build();
Breaking change: #2220
InstrumentationLibrary::newInstrumentationLibrary to InstrumentationScopeInstrumentationLibraryBuilder to InstrumentationScopeBuilderLoggerProvider::versioned_logger and TracerProvider::versioned_tracerLoggerProvider::logger_builder, TracerProvider::tracer_builder and MeterProvider::versioned_meterLoggerProvider::logger_with_scope, TracerProvider::logger_with_scope, MeterProvider::meter_with_scopeglobal::meter_with_version with global::meter_with_scopeglobal::tracer_with_scopeBreaking change: replaced InstrumentationScope public attributes by getters #2275
Breaking change: #2260
global::set_error_handler and global::handle_error.global::handle_error usage inside the opentelemetry crates has been replaced with global::otel_info, otel_warn, otel_debug and otel_error macros based on the severity of the internal logs.global::handle_error was to log the error using eprintln!. With otel macros, the internal logs get emitted via tracing macros of matching severity. Users now need to configure a tracing layer/subscriber to capture these logs.tracing::fmt layer.Breaking change for exporter/processor authors: #2266
ExportError trait from opentelemetry::ExportError to opentelemetry_sdk::export::ExportErroropentelemetry::trace::ExportError for trace API. This would be eventually be consolidated with ExportError in the SDK.LogError enum from opentelemetry::logs::LogError to opentelemetry_sdk::logs::LogErrorLogResult type alias from opentelemetry::logs::LogResult to opentelemetry_sdk::logs::LogResultMetricError enum from opentelemetry::metrics::MetricError to opentelemetry_sdk::metrics::MetricErrorMetricResult type alias from opentelemetry::metrics::MetricResult to opentelemetry_sdk::metrics::MetricResult
These changes shouldn't directly affect the users of OpenTelemetry crate, as these constructs are used in SDK and Exporters. If you are an author of an sdk component/plug-in, like an exporter etc. please use these types from sdk. Refer CHANGELOG.md for more details, under same version section.Breaking 2291 Rename logs_level_enabled flag to spec_unstable_logs_enabled. Please enable this updated flag if the feature is needed. This flag will be removed once the feature is stabilized in the specifications.
Removed: Key.bool(), Key.i64(), Key.f64(), Key.string(), Key.array() #2090. These APIs were redundant as they didn't offer any additional functionalit
Released 2024-Sep-30
BREAKING Public API changes:
Removed: Key.bool(), Key.i64(), Key.f64(), Key.string(), Key.array() #2090. These APIs were redundant as they didn't offer any additional functionality. The existing KeyValue::new() API covers all the scenarios offered by these APIs.
Removed: ObjectSafeMeterProvider and GlobalMeterProvider #2112. These APIs were unnecessary and were mainly meant for internal use.
Modified: MeterProvider.meter() and MeterProvider.versioned_meter() argument types have been updated to &'static str instead of impl Into<Cow<'static, str>>> #2112. These APIs were modified to enforce the Meter name, version, and schema_url to be &'static str.
Renamed: NoopMeterCore to NoopMeter
Added with_boundaries API to allow users to provide custom bounds for Histogram instruments. #2135
Released 2024-Sep-30
semconv_experimental to enable experimental semantic conventions.
This feature is disabled by default.BREAKING #1993 Box complex types in AnyValue enum Before: ```rust
#[derive(Debug, Clone, PartialEq)]
pub enum AnyValue {
/// An integer value
Int(i64),
/// A double value
Double(f64),
/// A string value
String(StringValue),
/// A boolean value
Boolean(bool),
/// A byte array
Bytes(Vec<u8>),
/// An array of `Any` values
ListAny(Vec<AnyValue>),
/// A map of string keys to `Any` values, arbitrarily nested.
Map(HashMap<Key, AnyValue>),
}
After:
#[derive(Debug, Clone, PartialEq)]
pub enum AnyValue {
/// An integer value
Int(i64),
/// A double value
Double(f64),
/// A string value
String(StringValue),
/// A boolean value
Boolean(bool),
/// A byte array
Bytes(Box<Vec<u8>>),
/// An array of `Any` values
ListAny(Box<Vec<AnyValue>>),
/// A map of string keys to `Any` values, arbitrarily nested.
Map(Box<HashMap<Key, AnyValue>>),
}
So the custom log appenders should box these types while adding them in message body, or attribute values. Similarly, the custom exporters should dereference these complex type values before serializing.
Breaking :
#2015 Removed
the ability to register callbacks for Observable instruments on Meter directly.
If you were using meter.register_callback to provide the callback, provide
them using with_callback method, while creating the Observable instrument
itself.
1715
shows the exact changes needed to make this migration. If you are starting new,
refer to the
examples
to learn how to provide Observable callbacks.
Add "metrics", "logs" to default features. With this, default feature list is "trace", "metrics" and "logs".
Add "metrics", "logs" to default features. With this, default feature list is "trace", "metrics" and "logs".
When "metrics" feature is enabled, KeyValue implements PartialEq, Eq,
PartialOrder, Order, Hash. This is meant to be used for metrics
aggregation purposes only.
Removed Unit struct for specifying Instrument units. Unit is treated as an
opaque string. Migration: Replace .with_unit(Unit::new("myunit")) with
.with_unit("myunit").
1869 Introduced the LogRecord::set_target() method in the log bridge API.
This method allows appenders to set the target/component emitting the logs.
Introduced the LogRecord trait in the API for populating log records. This trait is implemented by the SDK. This is the breaking change for the author…
PropagationErrorGauge no longer requires otel-unstable feature flag, as OpenTelemetry specification for Gauge instrument is stable.urlencoding crate dependency. #1613BREAKING Moving LogRecord implementation to the SDK. 1702.
LogRecord struct to SDK.LogRecord trait in the API for populating log records. This trait is implemented by the SDK.
This is the breaking change for the authors of Log Appenders. Refer to the opentelemetry-appender-tracing for more details.Deprecate versioned_logger() in favor of logger_builder() 1567.
Before:
let logger = provider.versioned_logger(
"my-logger-name",
Some(env!("CARGO_PKG_VERSION")),
Some("https://opentelemetry.io/schemas/1.0.0"),
Some(vec![KeyValue::new("key", "value")]),
);
After:
let logger = provider
.logger_builder("my-logger-name")
.with_version(env!("CARGO_PKG_VERSION"))
.with_schema_url("https://opentelemetry.io/schemas/1.0.0")
.with_attributes(vec![KeyValue::new("key", "value")])
.build();
versioned_tracer() in favor of tracer_builder() 1567.Before:
let tracer = provider.versioned_tracer(
"my-tracer-name",
Some(env!("CARGO_PKG_VERSION")),
Some("https://opentelemetry.io/schemas/1.0.0"),
Some(vec![KeyValue::new("key", "value")]),
);
After:
let tracer = provider
.tracer_builder("my-tracer-name")
.with_version(env!("CARGO_PKG_VERSION"))
.with_schema_url("https://opentelemetry.io/schemas/1.0.0")
.with_attributes(vec![KeyValue::new("key", "value")])
.build();
Modified AnyValue.Map to be backed by HashMap instead of custom OrderMap, which internally used IndexMap. There was no requirement to maintain the ord
#1410 Add experimental synchronous gauge. This is behind the feature flag, and can be enabled by enabling the feature otel_unstable for opentelemetry crate.
#1410 Guidelines to add new unstable/experimental features.
AnyValue.Map to be backed by HashMap instead of custom OrderMap,
which internally used IndexMap. There was no requirement to maintain the order
of entries, so moving from IndexMap to HashMap offers slight performance
gains, and avoids IndexMap dependency. This affects body and attributes of
LogRecord.
#1353TextMapCompositePropagator #1373NoopLogger to save on operations
#1455This release should been seen as 1.0-rc4 following 1.0-rc3 in v0.20.0. Refer to CHANGELOG.md in individual creates for details on changes made in diff
This release should been seen as 1.0-rc4 following 1.0-rc3 in v0.20.0. Refer to CHANGELOG.md in individual creates for details on changes made in different creates.
opentelemetry crate now only carries the API types #1186. Use the opentelemetry_sdk crate for the SDK types.trace::noop::NoopSpan no longer implements Default and instead exposes
a const DEFAULT value. #1270SpanBuilder attributes changed from OrderMap<Key, Value> to
Vec<KeyValue> and with_attributes_map method is removed from SpanBuilder.
This implies that OpenTelemetry API will no longer perform
de-dup of attribute Keys.
#1293.
Please share feedback
here, if
you are affected.This release should been seen as 1.0-rc3 following 1.0-rc2 in v0.19.0. Refer to CHANGELOG.md in individual creates for details on changes made in diff
This release should been seen as 1.0-rc3 following 1.0-rc2 in v0.19.0. Refer to CHANGELOG.md in individual creates for details on changes made in different creates.
new method to BoxedTracer #1009Context::map_current #1140opentelemetry::sdk::logs::config() for parity with opentelemetry::sdk::trace::config() (#1197)OtelString::Owned carries Box<str> instead of String #1096Context while reporting
measurements. #1076.futures-channel error types to LogError and
TraceError removed.
#1201This release should been seen as 1.0-rc2 following 1.0-rc1 in v0.18.0. Refer to CHANGELOG.md in individual creates for details on changes made in diff
This release should been seen as 1.0-rc2 following 1.0-rc1 in v0.18.0. Refer to CHANGELOG.md in individual creates for details on changes made in different creates.
This release is the first beta release of the trace API and SDK. If no other breaking changes are necessary, the next release will be 1.0. The metrics…
This release is the first beta release of the trace API and SDK. If no other
breaking changes are necessary, the next release will be 1.0. The metrics API
and SDK are still unstable.
OTEL_TRACES_SAMPLER_ARG in default sdk config #737schema_url to Tracer #743schema_url to Resource #775Span::set_attributes #638SpanExporter::force_flush and default implementation #845ValueRecorder in favor of Histogram #728IdGenerator to SDK, rename to RandomIdGenerator #742meter_with_version accepts optional parameter for version and schema_url #752Event and Link access patterns #757SpanKind display format impl to jaeger crate #758TraceStateError private #755Span::record_exception to Span::record_error #756StatusCode and message with Status #760TracerProvider::force_flush to SDK #658SpanBuilder::attributes [breaking] #799pin-project-lite #830serialize feature #738StatusCode::as_str #741Tracer::with_span #746Implement Serialize & Deserialize for Sampler, SpanLimits #622, #626
Serialize & Deserialize for Sampler, SpanLimits #622, #626&'static str and string in span methods #654String data in instrumentation library. #670std::fmt::Debug and 'static requirements from TracerProvider,
Tracer, and Span #664Tracer::invalid method #683TracerProvider::tracer and TracerProvider::versioned_tracer methods #682futures crate #684ShouldSample parameters #695service.name from OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES #662TraceState::valid_key crashes #665Add default resource in TracerProvider #571
TracerProvider #571get_tracer to tracer #586trace::noop module and update docs #587Hash impl for span context and allow spans to clone and export current state #592SpanRef public #600SpanProcessor::on_start take a mutable span #601label to attribute to align with otel specification #609Resource::get #579opentelemetry_semantic_conventions::trace and opentelemetry_semantic_conventions::resource into opentelemetry_semantic_conventions::attribute (which now contains all semantic attributes). trace and resource now only contain references to attributes which fall under their respective category.opentelemetry_semantic_conventions::metric to store metric semantic conventions.Expose the Error type to allow users to set custom error handlers #551
Unit into metrics module #564#[tokio::test] #552TraceState cannot insert new key-value pairs #567Breaking Replaced Key constants with &'static str for tracing compatibility #1334
Upgrade note: exporter pipelines do not return an uninstall guard as of #444, use opentelemetry::shutdown_tracer_provider explicitly instead.
Upgrade note: exporter pipelines do not return an uninstall guard as of #444,
use opentelemetry::global::shutdown_tracer_provider explicitly instead.
Update to opentelemetry-api v0.20.0
Fix possible deadlock when dropping metric instruments #407
Fix remote implicit builder context sampling #405
Update to opentelemetry_http v0.8.
Update to opentelemetry v0.18.0
Nothing published for this version
Update to opentelemetry v0.17.0
Update to opentelemetry v0.16.0
New ParentOrElse sampler for fallback logic if parent is not sampled. #128
ParentOrElse sampler for fallback logic if parent is not sampled. #128record_exception and record_exception_with_stacktrace methods to Span #152Always is now AlwaysOn. Never is now AlwaysOff. Probability now ignores parent
sampled state.base64 and binary_propagator have been moved to experimental module. #134Correlation-Context header has been updated to otcorrelations #145B3Propagator has been updated to more closely follow the spec #148Add http and tonic features to impl Carrier for common types.
http and tonic features to impl Carrier for common types.span_id from sampling parameters when implementing custom samplers.Context Send + Sync in #127Derive Clone for B3Propagator, SamplingResult, and SpanBuilder
Clone for B3Propagator, SamplingResult, and SpanBuilderFrom<T> for common Key and Value typestracer methodResource APIContext APICorrelations APIHttpTextCompositePropagator for composing HttpTextPropagatorsGlobalPropagator for globally configuring a propagatorTraceContextExt to provide methods for working with trace data in a contextEvictedQueue constructorSpan are Send and Sync when used in globalKey and Value method signatures to remove Cow referencesstart now uses the implicit current context instead of an explicit span context.
start_with_context may be used to specify a context if desired.with_span now accepts a span for naming consistency and managing the active state of a more
complex span (likely produced by a builder), and the previous functionality that accepts a
&str has been renamed to in_span, both of which now yield a context to the provided closure.get_active_span now accepts a closureInstrument trait has been renamed to FutureExt to avoid clashing with metric instruments,
and instead accepts contexts via with_context.get_context method has been renamed to span_context to avoid ambiguity.HttpTextPropagators inject the current context instead of an explicit span context. The context
can be specified with inject_context.SpanData's context has been renamed to span_contextTraceparent header to traceparentTracerGenerics methods have been folded in to the Tracer trait so it is longer neededmark_span_as_inactive has been removedas_any methodmark_as_active, mark_as_inactive, and as_any have been removedfrom_env and use environment variables to initialize the configurations by default #459Update Span's add_event and add_event_with_timestamp to accept attributes.
trace_id to SpanBuilderattributes to Events.Span's add_event and add_event_with_timestamp to accept attributes.Linksstatus_message to Span and SpanDataSpanStatus to StatusCodeEvictedQueue internals from LIFO to FIFOEvictedHashMapshutdown correctly when span processors and exporters are droppedSwitch to SpanId and TraceId from u64 and u128
SpanId and TraceId from u64 and u128&mut self requirements for Span APIMake trace and metrics features optional
### Added - trace-context propagator ### Changed - Prometheus API cleanup
Parent option for default sampler
Ensure spans are always send and sync
### Added - Implement global provider
Tracking of active spans via thread local span stack
Initial debug alpha
Initial debug alpha
Your coding agent can read these notes before it upgrades. Set up the MCP server →