Skip to content

Commit

Permalink
Merge branch 'main' into add_tests_for_opentelemetry_appender_log
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbodd committed Jan 30, 2024
2 parents af32dce + e3bee4e commit e533d3a
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 30 deletions.
4 changes: 2 additions & 2 deletions opentelemetry-appender-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 5 additions & 5 deletions opentelemetry-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
10 changes: 5 additions & 5 deletions opentelemetry-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ 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" }
opentelemetry-http = { version = "0.10", path = "../opentelemetry-http", optional = true }
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 }
Expand All @@ -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"] }
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
32 changes: 32 additions & 0 deletions opentelemetry-otlp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
13 changes: 11 additions & 2 deletions opentelemetry-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion opentelemetry-sdk/src/logs/log_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-stdout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-zipkin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
8 changes: 7 additions & 1 deletion opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`]
Expand Down
4 changes: 2 additions & 2 deletions stress/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit e533d3a

Please sign in to comment.