This repository was archived by the owner on Jul 10, 2025. It is now read-only.
chore(deps): update opentelemetry #2353
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.23.0->0.30.00.16.0->0.30.00.4.0->0.30.00.23.0->0.30.00.24.0->0.31.0Release Notes
open-telemetry/opentelemetry-rust (opentelemetry)
v0.30.0Compare Source
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 thiscontext
with_telemetry_suppressed()- Creates a new context with telemetrysuppression enabled
is_current_telemetry_suppressed()- Efficiently checks if the current thread's contexthas telemetry suppressed
enter_telemetry_suppressed_scope()- Convenience method to enter a scope where telemetry issuppressed
These methods allow SDK components, exporters, and processors to temporarily
disable telemetry generation during their internal operations, ensuring more
predictable and efficient observability pipelines.
tracingforinternal-logsfeature to remove the need of addingtracingas a dependencyv0.29.1Compare Source
Release 2025-Apr-01
WithContextatopentelemetry::trace::context::WithContext#2879 to restore backwards compatabilityWithContextandFutureExtare inopentelemetry::contextas they are independent of the trace signal. Users should prefer this path.v0.29.0Compare Source
Released 2025-Mar-21
ExportErrortrait fromopentelemetry::trace::ExportErrortoopentelemetry_sdk::export::ExportErrorTraceErrorenum fromopentelemetry::trace::TraceErrortoopentelemetry_sdk::trace::TraceErrorTraceResulttype alias fromopentelemetry::trace::TraceResulttoopentelemetry_sdk::trace::TraceResultInstrumentationScopeimplementation forPartialEqandHashfixed to include Attributes also.BaggagefromValuetoStringValueBaggageconstants 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 referenceBaggagecan't be retrieved from theContextdirectly anymore and needs to be accessed viacontext.baggage()with_baggage()andcurrent_with_baggage()override any existingBaggagein theContextBaggagekeys can't be empty and only allow ASCII visual chars, except"(),/:;<=>?@​[\]{}(see RFC7230, Section 3.2.6)KeyValueMetadatadoes not publicly expose its fields. This should be transparent change to the users.Contextto use a stack to properly handle out of order dropping ofContextGuard. This imposes a limit of65535nested contexts on a single thread. See #2378 and #1887.name: Option<&str>parameter to theevent_enabledmethodon the
Loggertrait. This allows implementations (SDK, processor, exporters)to leverage this additional information to determine if an event is enabled.
v0.28.0Compare Source
Released 2025-Feb-10
opentelemetry::global::shutdown_tracer_provider()Removed from this crate, should now usetracer_provider.shutdown()see #2369 for a migration example.opentelemetry::PropagationErrorstruct.v0.27.1Compare Source
Released 2024-Nov-27
v0.27.0Compare Source
Released 2024-Nov-11
LogRecord::set_trace_context; an optional method conditional on thetracefeature for setting trace context on a log record.as_anyfromAsyncInstrumenttrait and the implementing instruments:ObservableCounter,ObservableGauge, andObservableUpDownCounter#2187SyncInstrumenttrait to replace the individual synchronous instrument traits (SyncCounter,SyncGauge,SyncHistogram,SyncUpDownCounter) which are meant for SDK implementation. #2207observemethod on asynchronous instruments can only be called inside a callback. This was done by removing the implementation ofAsyncInstrumenttrait for each of the asynchronous instruments. #2210PartialOrdandOrdimplementations forKeyValue. #2215KeyValuerelated structs and enums asnon_exhaustive. #2228AnyValueenum asnon_exhaustive. #2230initmethod used to create instruments has been renamed tobuild. Also,try_init()method is removed from instrument builders. The return types ofInstrumentProvidertrait methods modified to return the instrument struct, instead ofResult. #2227Before:
Now:
Breaking change: #2220
InstrumentationLibrary::newInstrumentationLibrarytoInstrumentationScopeInstrumentationLibraryBuildertoInstrumentationScopeBuilderLoggerProvider::versioned_loggerandTracerProvider::versioned_tracerLoggerProvider::logger_builder,TracerProvider::tracer_builderandMeterProvider::versioned_meterLoggerProvider::logger_with_scope,TracerProvider::logger_with_scope,MeterProvider::meter_with_scopeglobal::meter_with_versionwithglobal::meter_with_scopeglobal::tracer_with_scopeBreaking change: replaced
InstrumentationScopepublic attributes by getters #2275Breaking change: #2260
global::set_error_handlerandglobal::handle_error.global::handle_errorusage inside the opentelemetry crates has been replaced withglobal::otel_info,otel_warn,otel_debugandotel_errormacros based on the severity of the internal logs.global::handle_errorwas to log the error usingeprintln!. With otel macros, the internal logs get emitted viatracingmacros of matching severity. Users now need to configure atracinglayer/subscriber to capture these logs.tracing::fmtlayer.Breaking change for exporter/processor authors: #2266
ExportErrortrait fromopentelemetry::ExportErrortoopentelemetry_sdk::export::ExportErroropentelemetry::trace::ExportErrorfor trace API. This would be eventually be consolidated with ExportError in the SDK.LogErrorenum fromopentelemetry::logs::LogErrortoopentelemetry_sdk::logs::LogErrorLogResulttype alias fromopentelemetry::logs::LogResulttoopentelemetry_sdk::logs::LogResultMetricErrorenum fromopentelemetry::metrics::MetricErrortoopentelemetry_sdk::metrics::MetricErrorMetricResulttype alias fromopentelemetry::metrics::MetricResulttoopentelemetry_sdk::metrics::MetricResultThese 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 flagtospec_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.v0.26.0Compare Source
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 existingKeyValue::new()API covers all the scenarios offered by these APIs.Removed:
ObjectSafeMeterProviderandGlobalMeterProvider#2112. These APIs were unnecessary and were mainly meant for internal use.Modified:
MeterProvider.meter()andMeterProvider.versioned_meter()argument types have been updated to&'static strinstead ofimpl Into<Cow<'static, str>>>#2112. These APIs were modified to enforce the Metername,version, andschema_urlto be&'static str.Renamed:
NoopMeterCoretoNoopMeterAdded
with_boundariesAPI to allow users to provide custom bounds for Histogram instruments. #2135v0.25.0Compare Source
Before:
After:
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_callbackto provide the callback, providethem using
with_callbackmethod, while creating the Observable instrumentitself.
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.
v0.24.0Compare Source
Add "metrics", "logs" to default features. With this, default feature list is
"trace", "metrics" and "logs".
When "metrics" feature is enabled,
KeyValueimplementsPartialEq,Eq,PartialOrder,Order,Hash. This is meant to be used for metricsaggregation purposes only.
Removed
Unitstruct for specifying Instrument units. Unit is treated as anopaque 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.
open-telemetry/opentelemetry-rust (opentelemetry-otlp)
v0.30.0Compare Source
Released 2025-May-23
opentelemetrydependency version to 0.30opentelemetry_sdkdependency version to 0.30opentelemetry-httpdependency version to 0.30opentelemetry-protodependency version to 0.30tonicdependency version to 0.13tonictypes undertonic_types2898
MetricExporterBuilder,SpanExporterBuilder, andLogExporterBuildertypes, enabling users to directly reference and use thesebuilder types for metrics, traces, and logs exporters.
2966
v0.29.0Compare Source
Released 2025-Mar-21
Update
opentelemetrydependency version to 0.29Update
opentelemetry_sdkdependency version to 0.29Update
opentelemetry-httpdependency version to 0.29Update
opentelemetry-protodependency version to 0.29The
OTEL_EXPORTER_OTLP_TIMEOUT,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT,OTEL_EXPORTER_OTLP_METRICS_TIMEOUTandOTEL_EXPORTER_OTLP_LOGS_TIMEOUTare changed from seconds to miliseconds.Fixed
.with_headers()inHttpExporterBuilderto correctly support multiple key/value pairs. #2699Fixed
#2770
partially to properly handle
shutdown()when usinghttp. (tonicstilldoes not do proper shutdown)
Breaking
ExporterBuilder's build() method now Result with
ExporterBuildErrorbeing theError variant. Previously it returned signal specific errors like
LogErrorfrom the
opentelemetry_sdk, which are no longer part of the sdk. No changesrequired if you were using unwrap/expect. If you were matching on the returning
Error enum, replace with the enum
ExporterBuildError. Unlike the previousErrorwhich contained many variants unrelated to building an exporter, thenew one returns specific variants applicable to building an exporter. Some
variants might be applicable only on select features.
Also, now unused
Errorenum is removed.Breaking
ExportConfig'stimeoutfield is now optional(Option<Duration>)Breaking Export configuration done via code is final. ENV variables cannot be used to override the code config.
Do not use code based config, if there is desire to control the settings via ENV variables.
List of ENV variables and corresponding setting being affected by this change.
OTEL_EXPORTER_OTLP_ENDPOINT->ExportConfig.endpointOTEL_EXPORTER_OTLP_TIMEOUT->ExportConfig.timeoutv0.28.0Compare Source
Released 2025-Feb-10
opentelemetrydependency version to 0.28.opentelemetry_sdkdependency version to 0.28.opentelemetry-httpdependency version to 0.28.opentelemetry-protodependency version to 0.28.LogRecord's
event_name()is now automatically populated on the newly added"event_name" field in LogRecord proto definition.
"reqwest-blocking-client" features as default, to align with the
specification.
2516
opentelemetry_otlp::metrics::MetricsClientand
MetricExporter::new(..)method. UseMetricExporter::builder()...build()to obtainMetricExporter.export timeout interval configured in below order
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT,OTEL_EXPORTER_OTLP_LOGS_TIMEOUTorOTEL_EXPORTER_OTLP_TIMEOUT.OTEL_EXPORTER_OTLP_TIMEOUTenv variable.with_http().with_timeout()API method ofLogExporterBuilderandSpanExporterBuilderandMetricsExporterBuilder.v0.27.0Compare Source
Released 2024-Nov-11
Update
opentelemetrydependency version to 0.27Update
opentelemetry_sdkdependency version to 0.27Update
opentelemetry-httpdependency version to 0.27Update
opentelemetry-protodependency version to 0.27BREAKING:
(#2217) Replaced: The
MetricsExporterBuilderinterface is modified fromwith_temporality_selectortowith_temporalityexample can be seen below:Previous Signature:
Updated Signature:
(#2221) Replaced:
opentelemetry_otlp::new_pipeline().{trace,logging,metrics}()interface is now replaced with{TracerProvider,SdkMeterProvider,LoggerProvider}::builder().opentelemetry_otlp::new_exporter()interface is now replaced with{SpanExporter,MetricsExporter,LogExporter}::builder().Pull request #2221 has a detailed migration guide in the description. See example below,
and basic-otlp for more details:
Previous Signature:
Updated Signature:
Renamed
MetricsExporter->MetricExporterMetricsExporterBuilder->MetricExporterBuilder#2263
Support
hyperclient for opentelemetry-otlp. This can be enabled using flaghyper-client.Refer example: https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp/examples/basic-otlp-http
v0.26.0Compare Source
Released 2024-Sep-30
opentelemetrydependency version to 0.26opentelemetry_sdkdependency version to 0.26opentelemetry-httpdependency version to 0.26opentelemetry-protodependency version to 0.26v0.25.0Compare Source
opentelemetrydependency version to 0.25opentelemetry_sdkdependency version to 0.25opentelemetry-httpdependency version to 0.25opentelemetry-protodependency version to 0.25opentelemetrycrateon major,minor versions.
The logrecord event-name is added as an attribute only if the feature flag
populate-logs-event-nameis enabled. The name of the attribute is changed from"name" to "event.name".
1994,
2050
v0.17.0Compare Source
"trace", "metrics" and "logs".
OtlpMetricPipeline.build()no longer invoke theglobal::set_meter_provider. User who setup the pipeline must do itthemselves using
global::set_meter_provider(meter_provider.clone());.with_resourceonOtlpLogPipeline, replacing thewith_configmethod.Instead of using
.with_config(Config::default().with_resource(RESOURCE::default()))users mustnow use
.with_resource(RESOURCE::default())to configure Resource when usingOtlpLogPipeline.OtlpTracePipeline::install_simple()andOtlpTracePipeline::install_batch()would now returnTracerProviderinstead ofTracer.These methods would also no longer set the global tracer provider. It would now be the responsibility of users to set it by calling
global::set_tracer_provider(tracer_provider.clone());. Refer to the basic-otlp and basic-otlp-http examples on how to initialize OTLP Trace Exporter.previous release.
targetfromLogRecord, if target is populated.LogRecordandSpanby their resource and instrumentation scope before exporting, for better efficiency #1873.httpv1 andtonicv0.12 #1674opentelemetrydependency version to 0.24opentelemetry_sdkdependency version to 0.24opentelemetry-httpdependency version to 0.13opentelemetry-protodependency version to 0.7open-telemetry/opentelemetry-rust (opentelemetry-stdout)
v0.30.0Compare Source
Released 2025-May-23
opentelemetrydependency to version 0.30.0.opentelemetry_sdkdependency to version 0.30.0.v0.29.0Compare Source
Released 2025-Mar-21
opentelemetrydependency version to 0.29.opentelemetry_sdkdependency version to 0.29.v0.28.0Compare Source
Released 2025-Feb-10
opentelemetrydependency version to 0.28.opentelemetry_sdkdependency version to 0.28.StartTimeandEndTimeis printed on aggregation (Sum, Gauge, Histogram, ExpoHistogram) with 2 tabs, previously it was on aggregation data point, with 3 tabs, see #2377 and #2411.ordered-float.LogRecord's
event_name()is now automatically displayed.v0.27.0Compare Source
Released 2024-Nov-11
Update
opentelemetrydependency version to 0.27Update
opentelemetry_sdkdependency version to 0.27Bump MSRV to 1.70 #2179
BREAKING
MetricsExporterBuilderinterface is modified fromwith_temporality_selectortowith_temporalityexample can be seen below:Previous Signature:
MetricsExporter->MetricExporterMetricsExporterBuilder->MetricExporterBuilderv0.26.0Compare Source
Released 2024-Sep-30
opentelemetrydependency version to 0.26opentelemetry_sdkdependency version to 0.26v0.25.0Compare Source
opentelemetrydependency version to 0.25opentelemetry_sdkdependency version to 0.25opentelemetrycrateon major,minor versions.
key
nameonly if the feature flagpopulate-logs-event-nameis enabled.v0.5.0Compare Source
opentelemetrydependency version to 0.24opentelemetry_sdkdependency version to 0.24open-telemetry/opentelemetry-rust (opentelemetry_sdk)
v0.30.0Compare Source
Released 2025-May-23
Updated
opentelemetryandopentelemetry-httpdependencies to version 0.30.0.It is now possible to add links to a
Spanvia theSpanRefthat you get froma
Context. 2959Feature: Added context based telemetry suppression. #2868
SdkLogger,SdkTracermodified to respect telemetry suppression based onContext. In other words, if the current context has telemetry suppressionenabled, then logs/spans will be ignored.
components to prevent telemetry from itself being fed back into OTel.
BatchLogProcessor,BatchSpanProcessor, andPeriodicReadermodified to setthe suppression flag in their dedicated thread, so that telemetry generated from
those threads will not be fed back into OTel.
SimpleLogProcessoralso modified to suppress telemetry before invoking exporters.
Feature: Implemented and enabled cardinality capping for Metrics by
default. #2901
configurability but has now been reintroduced with the ability to configure
the limit.
trueinstead of the string
"true".#2878
The
shutdown_with_timeoutmethod is added to SpanProcessor, SpanExporter trait and TracerProvider.The
shutdown_with_timeoutmethod is added to LogExporter trait.The
shutdown_with_timeoutmethod is added to LogProvider and LogProcessor trait.Breaking
MetricError,MetricResultno longer public (except whenspec_unstable_metrics_viewsfeature flag is enabled).OTelSdkResultshouldbe used instead, wherever applicable. #2906
Breaking change, affecting custom
MetricReaderauthors:shutdown_with_timeoutmethod is added toMetricReadertrait.collectmethod on
MetricReadermodified to returnOTelSdkResult.#2905
MetricReadertrait,
ManualReaderstruct,Pipelinestruct,InstrumentKindenum movedbehind feature flag "experimental_metrics_custom_reader".
#2928
Views improvements:
name, unit, description, and cardinality limit of a metric via views without
enabling the
spec_unstable_metrics_viewsfeature flag. Advanced viewfeatures, such as custom aggregation or attribute filtering, still require
the
spec_unstable_metrics_viewsfeature.new_view()method andViewtrait. Views can now be added by passinga function with signature
Fn(&Instrument) -> Option<Stream>to thewith_viewmethod on
MeterProviderBuilder.Introduced a builder pattern for
Streamcreation to use with views:StreamBuilderstruct with methods to configure stream propertiesStream::builder()method that returns a newStreamBuilderStreamBuilder::build()returnsResult<Stream, Box<dyn Error>>enablingproper validation.
Example of using views to rename a metric:
Aggregationenum moved behind feature flag"spec_unstable_metrics_views". This was only required when using advanced view
capabilities.
#2928
PushMetricExporterauthors:exportmethod onPushMetricExporternow accepts&ResourceMetricsinstead of
&mut ResourceMetrics.ResourceMetricsno longer exposesscope_metricsfield, but insteadoffers
scope_metrics()method that returns an iterator over the same.ScopeMetricsno longer exposesmetricsfield, but instead offersmetrics()method that returns an iterator over the same.Sum,Gauge,Histogram&ExponentialHistogramno longer exposesdata_pointsfield, but instead offersdata_points()method that returnsan iterator over the same.
SumDataPoint,GaugeDataPoint,HistogramDataPoint&ExponentialHistogramDataPointno longer exposesattributes,exemplarsfield, but instead offers
attributes(), andexemplars()method thatreturns an iterator over the same.
Exemplarno longer exposesfiltered_attributesfield, but insteadoffers
filtered_attributes()method that returns an iterator overthe same.
HistogramDataPointno longer exposesboundsandbucket_counts, butinstead offers
bounds()andbucket_counts()methods that returns aniterator over the same.
Metricno longer exposesname,description,unit,datafields, butinstead offers
name(),description(),unit(), anddata()accessor methods.ResourceMetricsno longer exposesresourcefield, but instead offersa
resource()accessor method.ScopeMetricsno longer exposesscopefield, but instead offersa
scope()accessor method.v0.29.0Compare Source
Released 2025-Mar-21
opentelemetrydependency to 0.29.opentelemetry-httpdependency to 0.29.Runtimetrait has been simplified and refined. See the #2641for the changes.
async-stdsupport forRuntime, asasync-stdcrate is deprecated.MeterProviderBuilder::with_resource,TracerProviderBuilder::with_resource,LoggerProviderBuilder::with_resourceare now additive (#2677).ExportErrortrait fromopentelemetry::trace::ExportErrortoopentelemetry_sdk::export::ExportErrorTraceErrorenum fromopentelemetry::trace::TraceErrortoopentelemetry_sdk::trace::TraceErrorTraceResulttype alias fromopentelemetry::trace::TraceResulttoopentelemetry_sdk::trace::TraceResultforce_flush()inPushMetricExportersynchronousSpanExportertrait method signature:to
This affects anyone who writes custom exporters, as custom implementations of SpanExporter
should now define export as an
async fn:Breaking The SpanExporter::export() method no longer requires a mutable reference to self.
Before:
After:
Custom exporters will need to internally synchronize any mutable state, if applicable.
Breaking The
shutdown_with_timeoutmethod is added to MetricExporter trait. This is breaking change for customMetricExporterauthors.Bug Fix:
BatchLogProcessornow correctly callsshutdownon the exporterwhen its
shutdownis invoked.Reduced some info level logs to debug
Breaking for custom LogProcessor/Exporter authors: Changed
nameparameter from
&strtoOption<&str>inevent_enabledmethod on theLogProcessorandLogExportertraits.SdkLoggerno longer passes itsscopename but instead passes the incomingnamewhen invokingevent_enabledon processors.Breaking for custom LogExporter authors:
shutdown()method inLogExportertrait no longer requires a mutable ref toself. If the exporterneeds to mutate state, it should rely on interior mutability.
2764
Breaking (Affects custom Exporter/Processor authors only) Removed
opentelelemetry_sdk::logs::error::{LogError, LogResult}. These were notintended to be public. If you are authoring custom processor/exporters, use
opentelemetry_sdk::error::OTelSdkErrorandopentelemetry_sdk::error::OTelSdkResult.2790
Breaking for custom
LogProcessorauthors: Changedset_resourceto require mutable ref.
fn set_resource(&mut self, _resource: &Resource) {}Breaking: InMemoryExporter's return type change.
TraceResult<Vec<SpanData>>toResult<Vec<SpanData>, InMemoryExporterError>MetricResult<Vec<ResourceMetrics>>toResult<Vec<ResourceMetrics>, InMemoryExporterError>LogResult<Vec<LogDataWithResource>>toResult<Vec<LogDataWithResource>, InMemoryExporterError>v0.28.0Compare Source
Released 2025-Feb-10
Note: Due to the large amount of making changes, check migration guide to
0.28 for a summary that can help majority users to
quickly migrate. The changelog below is the full list of changes.
Update
opentelemetrydependency to 0.28.Update
opentelemetry-httpdependency to 0.28.Bump msrv to 1.75.0.
Bug fix: For cumulative temporality, ObservableGauge no longer export
MetricPoints unless measurements were newly reported (in Observable callbacks)
since last export. This bug fixes ensures ObservableGauge behaves as per OTel
Spec. The bug is not addressed for other Observable instruments
#2213
Upgrade the tracing crate used for internal logging to version 0.1.40 or
later. This is necessary because the internal logging macros utilize the name
field as metadata, a feature introduced in version 0.1.40.
#2418
Feature: Introduced a new feature flag,
experimental_metrics_disable_name_validation, which disables entireInstrument Name Validation. This is an experimental feature to unblock use
cases requiring currently disallowed characters (eg: Windows Perf Counters).
Use caution when enabling this feature as this breaks guarantees about metric
name.
Bug fix: Empty Tracer names are retained as-is instead of replacing with
"rust.opentelemetry.io/sdk/tracer"
#2486
Update
EnvResourceDetectorto allow resource attribute values containingequal signs (
"=").#2120
ResourceDetector.detect()no longer supports timeout option.Breaking Resource.get() modified to require reference to Key instead of
owned. Replace
get(Key::from_static_str("key"))withget(&Key::from_static_str("key"))Feature: Add
ResourceBuilderfor an easy way to create newResourcesBreaking: Remove
Resource::{new,empty,from_detectors,new_with_defaults,from_schema_url,merge,default}.To create Resources you should only use
Resource::builder()orResource::builder_empty(). See#2322 for a migration guide.
Example Usage:
Breaking :
#2314
impacts custom exporter and processor developers by requiring updates to
code that directly accessed LogRecord fields. They must now use the provided
getter methods (e.g.,
log_record.event_name()instead oflog_record.event_name).Breaking (Affects custom metric exporter authors only)
start_timeandtimeis moved from DataPoints to aggregations (Sum, Gauge, Histogram,ExpoHistogram) see
#2377 and
#2411, to
reduce memory.
Breaking
start_timeis no longer optional forSumaggregation, see#2367, but
is still optional for
Gaugeaggregation see#2389.
SimpleLogProcessor modified to be generic over
LogExporterto avoiddynamic dispatch to invoke exporter. If you were using
with_simple_exporterto addLogExporterwith SimpleLogProcessor, this isa transparent change.
#2338
Breaking
opentelemetry::global::shutdown_tracer_provider()removed from the API,should now use
tracer_provider.shutdown()see#2369 for
a migration example. "Tracer provider" is cheaply clonable, so users are
encouraged to set a clone of it as the global (ex:
global::set_tracer_provider(provider.clone())), so that instrumentationsand other components can obtain tracers from
global::tracer(). Thetracer_provider must be kept around to call shutdown on it at the end of
application (ex:
tracer_provider.shutdown())Breaking The LogExporter::export() method no longer requires a mutable
reference to self.: Before:
async fn export(&mut self, _batch: LogBatch<'_>) -> LogResult<()>After:async fn export(&self, _batch: LogBatch<'_>) -> LogResult<()>Custom exporters will need to internally synchronize anymutable state, if applicable.
Breaking Removed the following deprecated struct:
This structure is no longer utilized within the SDK, and users should not have
dependencies on it.
Breaking Removed the following deprecated methods:
Logger::provider(): Previously deprecated in version 0.27.1Logger::instrumentation_scope(): Previously deprecated in version 0.27.1.Migration Guidance: - These methods were intended for log appender authors.
Keep the clone of the provider handle, instead of depending on above
methods.
Rename
opentelemetry_sdk::logs::Buildertoopentelemetry_sdk::logs::LoggerProviderBuilder.Rename
opentelemetry_sdk::trace::Buildertoopentelemetry_sdk::trace::SdkTracerProviderBuilder.Redesigned PeriodicReader, BatchSpanProcessor, BatchLogProcessor to no longer
require an async runtime. They create its own background thread instead. When
pairing with OTLP,
grpc-tonicorreqwest-blocking-clientare the onlysupported features (
hyper,reqwestare not supported) These are nowenabled by default and can be migrated to by removing the extra
rt:Runtimeargument as shown below.
PeriodicReader::builder(exporter,runtime::Tokio).build();toPeriodicReader::builder(exporter).build();.with_batch_exporter(exporter, runtime::Tokio)to.with_batch_exporter(exporter)The new implementation has following limitations:
hyper,reqwestHTTP Clientswith_max_concurrent_exportsis not supported). This existed only for traces.
If this applies to you, you can get the old behavior back by following steps
below:
experimental_metrics_periodicreader_with_async_runtimeexperimental_logs_batch_log_processor_with_async_runtimeexperimental_trace_batch_span_processor_with_async_runtimeperiodic_reader_with_async_runtime::PeriodicReader,log_processor_with_async_runtime::BatchLogProcessorandspan_processor_with_async_runtime::BatchSpanProcessorrt-tokio,rt-tokio-current-thread, orrt-async-std.As part of the above redesign of PeriodicReader and BatchProcessors, these
components no longer enforce timeout themselves and instead relies on
Exporters to enforce own timeouts. In other words, the following are no longer
supported.
with_max_export_timeout,with_timeoutmethods onBatchConfigBuilder,PeriodicReaderBuilderOTEL_BLRP_EXPORT_TIMEOUT,OTEL_BSP_EXPORT_TIMEOUTUsers are advised to configure timeout on the Exporters itself. For example,
in the OTLP exporter, the export timeout can be configured using:
OTEL_EXPORTER_OTLP_TIMEOUTOTEL_EXPORTER_OTLP_LOGS_TIMEOUT,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT.with_tonic().with_timeout()or.with_http().with_timeout().Breaking Introduced
experimental_async_runtimefeature forruntime-specific traits.
rt-tokio,rt-tokio-current-thread, andrt-async-std) now depend on theexperimental_async_runtimefeature.rt-tokio,rt-tokio-current-thread, orrt-async-stdwill automaticallyenable the
experimental_async_runtimefeature.experimental_async_runtime
feature in your Cargo.toml and implement the requiredRuntime` traits.Removed Metrics Cardinality Limit feature. This was originally introduced in
#1066 with a
hardcoded limit of 2000 and no ability to change it. This feature will be
re-introduced in a future date, along with the ability to change the cardinality
limit.
Breaking Removed unused
opentelemetry_sdk::Errorenum.Breaking (Affects custom Exporter authors only) Moved
ExportErrortraitfrom
opentelemetry::export::ExportErrortoopentelemetry_sdk::ExportErrorBreaking (Affects custom SpanExporter, SpanProcessor authors only): Rename
namespaces for Span exporter structs/traits before:
opentelemetry_sdk::export::spans::{ExportResult, SpanData, SpanExporter};now:
opentelemetry_sdk::trace::{ExportResult, SpanData, SpanExporter};Breaking (Affects custom LogExporter, LogProcessor authors only): Rename
namespaces for Log exporter structs/traits. before:
opentelemetry_sdk::export::logs::{ExportResult, LogBatch, LogExporter};now:opentelemetry_sdk::logs::{ExportResult, LogBatch, LogExporter};Breaking
opentelemetry_sdk::LogRecord::default()method is removed. Theonly way to create log record outside opentelemetry_sdk crate is using
Logger::create_log_record()method.Breaking: Rename namespaces for InMemoryExporters. (The module is still
under "testing" feature flag)
before:
now:
Breaking Renamed
LoggerProvider,LoggerandLogRecordtoSdkLoggerProvider,SdkLoggerandSdkLogRecordrespectively to avoid namecollision with public API types.
#2612
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.