diff --git a/.cspell.json b/.cspell.json index be8b4c0cda..fd5a476fb7 100644 --- a/.cspell.json +++ b/.cspell.json @@ -31,6 +31,7 @@ "Bhasin", "Cijo", "clippy", + "clonable", "codecov", "datapoint", "deque", @@ -52,6 +53,7 @@ "OTELCOL", "OTLP", "periodicreader", + "prost", "protoc", "quantile", "Redelmeier", diff --git a/examples/tracing-grpc/src/client.rs b/examples/tracing-grpc/src/client.rs index 18c42cec6f..2247aa846f 100644 --- a/examples/tracing-grpc/src/client.rs +++ b/examples/tracing-grpc/src/client.rs @@ -1,7 +1,7 @@ use hello_world::greeter_client::GreeterClient; use hello_world::HelloRequest; use opentelemetry::{global, propagation::Injector}; -use opentelemetry_sdk::{propagation::TraceContextPropagator, runtime::Tokio, trace as sdktrace}; +use opentelemetry_sdk::{propagation::TraceContextPropagator, trace as sdktrace}; use opentelemetry_stdout::SpanExporter; use opentelemetry::{ diff --git a/examples/tracing-grpc/src/server.rs b/examples/tracing-grpc/src/server.rs index 3dbb012321..13d10804ce 100644 --- a/examples/tracing-grpc/src/server.rs +++ b/examples/tracing-grpc/src/server.rs @@ -5,9 +5,7 @@ use opentelemetry::{ propagation::Extractor, trace::{Span, SpanKind, Tracer}, }; -use opentelemetry_sdk::{ - propagation::TraceContextPropagator, runtime::Tokio, trace::TracerProvider, -}; +use opentelemetry_sdk::{propagation::TraceContextPropagator, trace::TracerProvider}; use opentelemetry_stdout::SpanExporter; use tonic::{transport::Server, Request, Response, Status}; diff --git a/examples/tracing-jaeger/src/main.rs b/examples/tracing-jaeger/src/main.rs index 7e06d8e921..f28eddec5e 100644 --- a/examples/tracing-jaeger/src/main.rs +++ b/examples/tracing-jaeger/src/main.rs @@ -4,7 +4,7 @@ use opentelemetry::{ KeyValue, }; use opentelemetry_sdk::trace::TracerProvider; -use opentelemetry_sdk::{runtime, Resource}; +use opentelemetry_sdk::Resource; use std::error::Error; diff --git a/opentelemetry-sdk/CHANGELOG.md b/opentelemetry-sdk/CHANGELOG.md index 140f41ed1f..937e3b0c6b 100644 --- a/opentelemetry-sdk/CHANGELOG.md +++ b/opentelemetry-sdk/CHANGELOG.md @@ -13,7 +13,7 @@ transparent change. [#2338](https://github.com/open-telemetry/opentelemetry-rust/pull/2338) - `ResourceDetector.detect()` no longer supports timeout option. - - `opentelemetry::global::shutdown_tracer_provider()` Removed from the API, should now use `tracer_provider.shutdown()` see [#2369](https://github.com/open-telemetry/opentelemetry-rust/pull/2369) for a migration example. "Tracer provider" is cheaply cloneable, so users are encouraged to set a clone of it as the global (ex: `global::set_tracer_provider(provider.clone()))`, so that instrumentations and other components can obtain tracers from `global::tracer()`. The tracer_provider must be kept around to call shutdown on it at the end of application (ex: `tracer_provider.shutdown()`) + - `opentelemetry::global::shutdown_tracer_provider()` removed from the API, should now use `tracer_provider.shutdown()` see [#2369](https://github.com/open-telemetry/opentelemetry-rust/pull/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 instrumentations and other components can obtain tracers from `global::tracer()`. The tracer_provider must be kept around to call shutdown on it at the end of application (ex: `tracer_provider.shutdown()`) - *Feature*: Add `ResourceBuilder` for an easy way to create new `Resource`s - *Breaking*: Remove `Resource::{new,empty,from_detectors,new_with_defaults,from_schema_url,merge,default}` from public api. To create Resources you should only use `Resource::builder()` or `Resource::builder_empty()`. See [#2322](https://github.com/open-telemetry/opentelemetry-rust/pull/2322) for a migration guide. Example Usage: diff --git a/opentelemetry-sdk/src/logs/log_emitter.rs b/opentelemetry-sdk/src/logs/log_emitter.rs index 479ca36dd2..ba63896277 100644 --- a/opentelemetry-sdk/src/logs/log_emitter.rs +++ b/opentelemetry-sdk/src/logs/log_emitter.rs @@ -140,7 +140,7 @@ impl LoggerProviderInner { // - Or the error occurs during `LoggerProviderInner::Drop` as part of telemetry shutdown, // which is non-actionable by the user match err { - // specific handling for mutex poisioning + // specific handling for mutex poisoning LogError::MutexPoisoned(_) => { otel_debug!( name: "LoggerProvider.Drop.ShutdownMutexPoisoned", diff --git a/opentelemetry-sdk/src/logs/log_processor.rs b/opentelemetry-sdk/src/logs/log_processor.rs index c5c5aeaa19..e46341eb6d 100644 --- a/opentelemetry-sdk/src/logs/log_processor.rs +++ b/opentelemetry-sdk/src/logs/log_processor.rs @@ -610,7 +610,7 @@ pub struct BatchConfigBuilder { impl Default for BatchConfigBuilder { /// Create a new [`BatchConfigBuilder`] initialized with default batch config values as per the specs. - /// The values are overriden by environment variables if set. + /// The values are overridden by environment variables if set. /// The supported environment variables are: /// * `OTEL_BLRP_MAX_QUEUE_SIZE` /// * `OTEL_BLRP_SCHEDULE_DELAY` diff --git a/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs b/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs index e5649d886b..b5a3df2197 100644 --- a/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs +++ b/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs @@ -591,7 +591,7 @@ mod tests { ); // - // deadloack happens in shutdown with tokio current_thread runtime + // deadlock happens in shutdown with tokio current_thread runtime // processor.shutdown().unwrap(); } @@ -837,7 +837,7 @@ mod tests { BatchLogProcessor::new(exporter.clone(), BatchConfig::default(), runtime::Tokio); // - // deadloack happens in shutdown with tokio current_thread runtime + // deadlock happens in shutdown with tokio current_thread runtime // processor.shutdown().unwrap(); } diff --git a/opentelemetry-sdk/src/metrics/periodic_reader.rs b/opentelemetry-sdk/src/metrics/periodic_reader.rs index 75afe29725..a5cd70fd99 100644 --- a/opentelemetry-sdk/src/metrics/periodic_reader.rs +++ b/opentelemetry-sdk/src/metrics/periodic_reader.rs @@ -350,7 +350,7 @@ impl PeriodicReaderInner { }); otel_debug!(name: "PeriodicReaderMetricsCollected", count = metrics_count); - // TODO: substract the time taken for collect from the timeout. collect + // TODO: subtract the time taken for collect from the timeout. collect // involves observable callbacks too, which are user defined and can // take arbitrary time. // @@ -887,7 +887,7 @@ mod tests { }) .build(); // rt here is a reference to the current tokio runtime. - // Droppng it occurs when the tokio::main itself ends. + // Dropping it occurs when the tokio::main itself ends. } else { let rt = tokio::runtime::Runtime::new().unwrap(); let _gauge = meter diff --git a/opentelemetry-sdk/src/trace/provider.rs b/opentelemetry-sdk/src/trace/provider.rs index 141850a759..6d6f35fd94 100644 --- a/opentelemetry-sdk/src/trace/provider.rs +++ b/opentelemetry-sdk/src/trace/provider.rs @@ -680,7 +680,7 @@ mod tests { // noop tracer's tracer provider should be shutdown assert!(noop_tracer.provider().is_shutdown()); - // existing tracer becomes noops after shutdown + // existing tracer becomes noop after shutdown let _ = test_tracer_1.start("test"); assert!(assert_handle.started_span_count(2)); diff --git a/opentelemetry-sdk/src/trace/span_processor.rs b/opentelemetry-sdk/src/trace/span_processor.rs index 12b94d6d47..53ee2f9bc0 100644 --- a/opentelemetry-sdk/src/trace/span_processor.rs +++ b/opentelemetry-sdk/src/trace/span_processor.rs @@ -132,7 +132,7 @@ impl SpanProcessor for SimpleSpanProcessor { .and_then(|mut exporter| futures_executor::block_on(exporter.export(vec![span]))); if let Err(err) = result { - // TODO: check error type, and log `error` only if the error is user-actiobable, else log `debug` + // TODO: check error type, and log `error` only if the error is user-actionable, else log `debug` otel_debug!( name: "SimpleProcessor.OnEnd.Error", reason = format!("{:?}", err) diff --git a/opentelemetry/CHANGELOG.md b/opentelemetry/CHANGELOG.md index fa94f47be1..5c5d280c43 100644 --- a/opentelemetry/CHANGELOG.md +++ b/opentelemetry/CHANGELOG.md @@ -3,6 +3,7 @@ ## vNext - Bump msrv to 1.75.0. +- **Breaking** `opentelemetry::global::shutdown_tracer_provider()` Removed from this crate, should now use `tracer_provider.shutdown()` see [#2369](https://github.com/open-telemetry/opentelemetry-rust/pull/2369) for a migration example. ## 0.27.1 diff --git a/opentelemetry/src/trace/noop.rs b/opentelemetry/src/trace/noop.rs index 4cb8ac4513..ffb4717f3a 100644 --- a/opentelemetry/src/trace/noop.rs +++ b/opentelemetry/src/trace/noop.rs @@ -1,4 +1,4 @@ -//! No-op trace impls +//! No-op trace implementation //! //! This implementation is returned as the global tracer if no `Tracer` //! has been set. It is also useful for testing purposes as it is intended