diff --git a/opentelemetry-appender-tracing/Cargo.toml b/opentelemetry-appender-tracing/Cargo.toml index b6b7cbee9a..9203101e2b 100644 --- a/opentelemetry-appender-tracing/Cargo.toml +++ b/opentelemetry-appender-tracing/Cargo.toml @@ -14,10 +14,10 @@ rust-version = "1.65" log = { workspace = true, optional = true } opentelemetry = { version = "0.21", path = "../opentelemetry", features = ["logs"] } opentelemetry_sdk = { version = "0.21", path = "../opentelemetry-sdk", features = ["logs"] } -tracing = { workspace = true, default-features = false, features = ["std"]} +tracing = { workspace = true, features = ["std"]} tracing-core = { workspace = true } tracing-log = { version = "0.2", optional = true } -tracing-subscriber = { workspace = true, default-features = false, features = ["registry", "std"] } +tracing-subscriber = { workspace = true, features = ["registry", "std"] } once_cell = "1.13.0" [dev-dependencies] diff --git a/opentelemetry-http/Cargo.toml b/opentelemetry-http/Cargo.toml index f9b8ee96c9..4429d148a7 100644 --- a/opentelemetry-http/Cargo.toml +++ b/opentelemetry-http/Cargo.toml @@ -13,9 +13,9 @@ rust-version = "1.65" async-trait = { workspace = true } bytes = { workspace = true } http = { workspace = true } -hyper = { workspace = true, default-features = false, features = ["http2", "client", "tcp"], optional = true } -isahc = { workspace = true, default-features = false, optional = true } +hyper = { workspace = true, features = ["http2", "client", "tcp"], optional = true } +isahc = { workspace = true, optional = true } opentelemetry = { version = "0.21", path = "../opentelemetry", features = ["trace"] } -reqwest = { workspace = true, default-features = false, features = ["blocking"], optional = true } -surf = { workspace = true, default-features = false, optional = true } -tokio = { workspace = true, default-features = false, features = ["time"], optional = true } +reqwest = { workspace = true, features = ["blocking"], optional = true } +surf = { workspace = true, optional = true } +tokio = { workspace = true, features = ["time"], optional = true } diff --git a/opentelemetry-jaeger/Cargo.toml b/opentelemetry-jaeger/Cargo.toml index 54bc16e554..92a5f30a3c 100644 --- a/opentelemetry-jaeger/Cargo.toml +++ b/opentelemetry-jaeger/Cargo.toml @@ -25,9 +25,9 @@ async-trait = { workspace = true } base64 = { version = "0.21.0", optional = true } headers = { version = "0.3.2", optional = true } http = { workspace = true, optional = true } -hyper = { workspace = true, default-features = false, features = ["client"], optional = true } +hyper = { workspace = true, features = ["client"], optional = true } hyper-tls = { version = "0.5.0", default-features = false, optional = true } -isahc = { workspace = true, default-features = false, optional = true } +isahc = { workspace = true, optional = true } js-sys = { version = "0.3", optional = true } opentelemetry = { version = "0.21", default-features = false, features = ["trace"], path = "../opentelemetry" } opentelemetry_sdk = { version = "0.21", default-features = false, features = ["trace"], path = "../opentelemetry-sdk" } @@ -35,7 +35,7 @@ opentelemetry-http = { version = "0.10", path = "../opentelemetry-http", optiona opentelemetry-semantic-conventions = { version = "0.13", path = "../opentelemetry-semantic-conventions" } opentelemetry-jaeger-propagator = { version = "0.1", path = "../opentelemetry-jaeger-propagator" } pin-project-lite = { workspace = true, optional = true } -reqwest = { workspace = true, default-features = false, optional = true } +reqwest = { workspace = true, optional = true } surf = { workspace = true, optional = true } thrift = "0.17.0" tokio = { workspace = true, features = ["net", "sync"], optional = true } @@ -47,9 +47,9 @@ prost = { version = "0.11.6", optional = true } prost-types = { version = "0.11.6", optional = true } # Futures -futures-executor = { workspace = true, default-features = false, features = ["std"], optional = true } +futures-executor = { workspace = true, features = ["std"], optional = true } futures-core = { workspace = true } -futures-util = { workspace = true, default-features = false, features = ["std", "alloc"]} +futures-util = { workspace = true, features = ["std", "alloc"]} [dev-dependencies] tokio = { workspace = true, features = ["net", "sync"] } diff --git a/opentelemetry-otlp/Cargo.toml b/opentelemetry-otlp/Cargo.toml index 375a6e3cc1..ce9fe6ae66 100644 --- a/opentelemetry-otlp/Cargo.toml +++ b/opentelemetry-otlp/Cargo.toml @@ -39,8 +39,8 @@ prost = { workspace = true, optional = true } tonic = { workspace = true, optional = true } tokio = { workspace = true, features = ["sync", "rt"], optional = true } -reqwest = { workspace = true, optional = true, default-features = false } -surf = { workspace = true, optional = true, default-features = false } +reqwest = { workspace = true, optional = true } +surf = { workspace = true, optional = true } http = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } thiserror = { workspace = true } @@ -51,7 +51,7 @@ tokio-stream = { workspace = true, features = ["net"] } opentelemetry_sdk = { features = ["trace", "rt-tokio", "testing"], path = "../opentelemetry-sdk" } time = { version = "0.3", features = ["macros"] } tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } -futures-util = { workspace = true, default-features = false } +futures-util = { workspace = true } temp-env = { workspace = true } [features] diff --git a/opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml b/opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml index 2a8a6731df..303696fb57 100644 --- a/opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml +++ b/opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml @@ -14,6 +14,6 @@ opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-traci opentelemetry-semantic-conventions = { path = "../../../opentelemetry-semantic-conventions" } tokio = { workspace = true, features = ["full"] } -tracing-subscriber = { workspace = true, default-features = false, features = ["registry", "std"] } -tracing = { workspace = true, default-features = false, features = ["std"] } +tracing-subscriber = { workspace = true, features = ["registry", "std"] } +tracing = { workspace = true, features = ["std"] } tracing-core = { workspace = true } diff --git a/opentelemetry-otlp/src/lib.rs b/opentelemetry-otlp/src/lib.rs index b886ad0601..ff346aef70 100644 --- a/opentelemetry-otlp/src/lib.rs +++ b/opentelemetry-otlp/src/lib.rs @@ -80,6 +80,38 @@ //! [`tokio`]: https://tokio.rs //! [`async-std`]: https://async.rs //! +//! # Feature Flags +//! The following feature flags can enable exporters for different telemetry signals: +//! +//! * `trace`: Includes the trace exporters (enabled by default). +//! * `metrics`: Includes the metrics exporters. +//! * `logs`: Includes the logs exporters. +//! +//! The following feature flags generate additional code and types: +//! * `serialize`: Enables serialization support for type defined in this create via `serde`. +//! +//! The following feature flags offer additional configurations on gRPC: +//! +//! For users uses `tonic` as grpc layer: +//! * `grpc-tonic`: Use `tonic` as grpc layer. This is enabled by default. +//! * `gzip-tonic`: Use gzip compression for `tonic` grpc layer. +//! * `tls-tonic`: Enable TLS. +//! * `tls-roots`: Adds system trust roots to rustls-based gRPC clients using the rustls-native-certs crate +//! +//! For users uses `grpcio` as grpc layer: +//! * `grpc-sys`: Use `grpcio` as grpc layer. +//! * `openssl`: Enable TLS supported by OpenSSL +//! * `openssl-vendored`: Same as `openssl` but it will build openssl from bundled sources. +//! +//! The following feature flags offer additional configurations on http: +//! +//! * `http-proto`: Use http as transport layer, protobuf as body format. +//! * `reqwest-blocking-client`: Use reqwest blocking http client. +//! * `reqwest-client`: Use reqwest http client. +//! * `reqwest-rustls`: Use reqwest with TLS. +//! * `surf-client`: Use surf http client. +//! +//! //! # Kitchen Sink Full Configuration //! //! Example showing how to override all configuration options. diff --git a/opentelemetry-proto/Cargo.toml b/opentelemetry-proto/Cargo.toml index e3c11e81dc..19bc3ae0dd 100644 --- a/opentelemetry-proto/Cargo.toml +++ b/opentelemetry-proto/Cargo.toml @@ -51,7 +51,7 @@ with-serde = ["serde", "hex"] [dependencies] grpcio = { workspace = true, optional = true, features = ["prost-codec"] } -tonic = { workspace = true, default-features = false, optional = true, features = ["codegen", "prost"] } +tonic = { workspace = true, optional = true, features = ["codegen", "prost"] } prost = { workspace = true, optional = true } opentelemetry = { version = "0.21", default-features = false, path = "../opentelemetry" } opentelemetry_sdk = { version = "0.21", default-features = false, path = "../opentelemetry-sdk" } diff --git a/opentelemetry-sdk/Cargo.toml b/opentelemetry-sdk/Cargo.toml index 570745d9ca..07ad5d8eb6 100644 --- a/opentelemetry-sdk/Cargo.toml +++ b/opentelemetry-sdk/Cargo.toml @@ -17,17 +17,17 @@ async-trait = { workspace = true, optional = true } crossbeam-channel = { version = "0.5", optional = true } futures-channel = "0.3" futures-executor = { workspace = true } -futures-util = { workspace = true, default-features = false, features = ["std", "sink", "async-await-macro"] } +futures-util = { workspace = true, features = ["std", "sink", "async-await-macro"] } once_cell = "1.10" ordered-float = { workspace = true } percent-encoding = { version = "2.0", optional = true } -rand = { workspace = true, default-features = false, features = ["std", "std_rng","small_rng"], optional = true } +rand = { workspace = true, features = ["std", "std_rng","small_rng"], optional = true } glob = { version = "0.3.1", optional =true} serde = { workspace = true, features = ["derive", "rc"], optional = true } serde_json = { workspace = true, optional = true } thiserror = { workspace = true } url = { workspace = true, optional = true } -tokio = { workspace = true, default-features = false, features = ["rt", "time"], optional = true } +tokio = { workspace = true, features = ["rt", "time"], optional = true } tokio-stream = { workspace = true, optional = true } http = { workspace = true, optional = true } diff --git a/opentelemetry-sdk/src/lib.rs b/opentelemetry-sdk/src/lib.rs index aefcd6f93c..f6fd471dcb 100644 --- a/opentelemetry-sdk/src/lib.rs +++ b/opentelemetry-sdk/src/lib.rs @@ -79,10 +79,19 @@ //! //! ## Crate Feature Flags //! -//! The following core crate feature flags are available: +//! The following feature flags can used to control the telemetry signals to use: //! //! * `trace`: Includes the trace SDK (enabled by default). -//! * `metrics`: Includes the unstable metrics SDK. +//! * `metrics`: Includes the metrics SDK. +//! * `logs`: Includes the logs SDK. +//! +//! For `trace` the following feature flags are available: +//! +//! * `jaeger_remote_sampler`: Enables the [Jaeger remote sampler](https://www.jaegertracing.io/docs/1.53/sampling/). +//! +//! For `logs` the following feature flags are available: +//! +//! * `logs_level_enabled`: control the log level //! //! Support for recording and exporting telemetry asynchronously can be added //! via the following flags: diff --git a/opentelemetry-sdk/src/logs/log_processor.rs b/opentelemetry-sdk/src/logs/log_processor.rs index 4b7c10499b..bda7730283 100644 --- a/opentelemetry-sdk/src/logs/log_processor.rs +++ b/opentelemetry-sdk/src/logs/log_processor.rs @@ -490,7 +490,15 @@ mod tests { #[test] fn test_default_batch_config_adheres_to_specification() { - let config = BatchConfig::default(); + // The following environment variables are expected to be unset so that their default values are used. + let env_vars = vec![ + OTEL_BLRP_SCHEDULE_DELAY, + OTEL_BLRP_EXPORT_TIMEOUT, + OTEL_BLRP_MAX_QUEUE_SIZE, + OTEL_BLRP_MAX_EXPORT_BATCH_SIZE, + ]; + + let config = temp_env::with_vars_unset(env_vars, BatchConfig::default); assert_eq!( config.scheduled_delay, diff --git a/opentelemetry-stdout/Cargo.toml b/opentelemetry-stdout/Cargo.toml index c3e9a25198..851fd70972 100644 --- a/opentelemetry-stdout/Cargo.toml +++ b/opentelemetry-stdout/Cargo.toml @@ -24,7 +24,7 @@ logs = ["opentelemetry/logs", "opentelemetry_sdk/logs", "async-trait", "thiserro async-trait = { workspace = true, optional = true } chrono = { version = "0.4.22", default-features = false, features = ["clock"] } thiserror = { workspace = true, optional = true } -futures-util = { workspace = true, optional = true, default-features = false } +futures-util = { workspace = true, optional = true } opentelemetry = { version = "0.21", path = "../opentelemetry", default_features = false } opentelemetry_sdk = { version = "0.21", path = "../opentelemetry-sdk", default_features = false } serde = { workspace = true, features = ["derive"] } diff --git a/opentelemetry-zipkin/Cargo.toml b/opentelemetry-zipkin/Cargo.toml index d87a84b089..89097670ad 100644 --- a/opentelemetry-zipkin/Cargo.toml +++ b/opentelemetry-zipkin/Cargo.toml @@ -37,8 +37,8 @@ serde = { workspace = true, features = ["derive"] } typed-builder = "0.12" once_cell = "1.12" http = { workspace = true } -reqwest = { workspace = true, optional = true, default-features = false } -surf = { workspace = true, optional = true, default-features = false } +reqwest = { workspace = true, optional = true} +surf = { workspace = true, optional = true} thiserror = { workspace = true } futures-core = { workspace = true } diff --git a/opentelemetry/src/lib.rs b/opentelemetry/src/lib.rs index c6753174fe..2e125817ab 100644 --- a/opentelemetry/src/lib.rs +++ b/opentelemetry/src/lib.rs @@ -96,9 +96,15 @@ //! The following core crate feature flags are available: //! //! * `trace`: Includes the trace API (enabled by default). -//! * `metrics`: Includes the unstable metrics API. +//! * `metrics`: Includes the metrics API. //! * `logs`: Includes the logs bridge API. //! +//! The following feature flags provides additional configuration for `logs`: +//! * `logs_level_enabled`: Allow users to control the log level +//! +//! The following feature flags enable APIs defined in OpenTelemetry specification that is in experimental phase: +//! * `otel_unstable`: Includes unstable APIs (enabled by default). +//! //! ## Related Crates //! //! In addition to `opentelemetry`, the [`open-telemetry/opentelemetry-rust`] diff --git a/stress/Cargo.toml b/stress/Cargo.toml index a6383a7f6a..bfeef7e938 100644 --- a/stress/Cargo.toml +++ b/stress/Cargo.toml @@ -33,7 +33,7 @@ opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["metrics", "log opentelemetry-appender-tracing = { path = "../opentelemetry-appender-tracing"} opentelemetry-stdout = { path = "../opentelemetry-stdout", features = ["logs"]} rand = { version = "0.8.4", features = ["small_rng"] } -tracing = { workspace = true, default-features = false, features = ["std"]} +tracing = { workspace = true, features = ["std"]} tracing-core = { workspace = true } -tracing-subscriber = { workspace = true, default-features = false, features = ["registry", "std"] } +tracing-subscriber = { workspace = true, features = ["registry", "std"] } num-format = "0.4.4"