From 871c0b91605714cb1facc834cff098b1ffeb4633 Mon Sep 17 00:00:00 2001 From: Kiryl Mialeshka <8974488+meskill@users.noreply.github.com> Date: Thu, 30 May 2024 12:42:08 +0200 Subject: [PATCH] chore: upgrade opentelemetry version (#2049) --- Cargo.lock | 134 ++++++++++++++++++++---------- Cargo.toml | 20 ++--- src/cli/telemetry.rs | 3 - tailcall-upstream-grpc/Cargo.toml | 12 +-- 4 files changed, 108 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 354909dee2..653b3c272d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ "multer", "num-traits", "once_cell", - "opentelemetry", + "opentelemetry 0.22.0", "pin-project-lite", "regex", "serde", @@ -3255,15 +3255,28 @@ dependencies = [ "urlencoding", ] +[[package]] +name = "opentelemetry" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b69a91d4893e713e06f724597ad630f1fa76057a5e1026c0ca67054a9032a76" +dependencies = [ + "futures-core", + "futures-sink", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", +] + [[package]] name = "opentelemetry-appender-tracing" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b811e9387ff25074c720debb71d4ef9e72a1c5087b4da292a8f61479febaf2" +checksum = "be314095f27dde46fca7038b023457d2b3459e1c39033dacc2ec1b31df11a61c" dependencies = [ "once_cell", - "opentelemetry", - "opentelemetry_sdk", + "opentelemetry 0.23.0", "tracing", "tracing-core", "tracing-subscriber", @@ -3271,29 +3284,28 @@ dependencies = [ [[package]] name = "opentelemetry-http" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7690dc77bf776713848c4faa6501157469017eaf332baccd4eb1cea928743d94" +checksum = "b0ba633e55c5ea6f431875ba55e71664f2fa5d3a90bd34ec9302eecc41c865dd" dependencies = [ "async-trait", "bytes", "http 0.2.12", - "opentelemetry", + "opentelemetry 0.23.0", ] [[package]] name = "opentelemetry-otlp" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb" +checksum = "a94c69209c05319cdf7460c6d4c055ed102be242a0a6245835d7bc42c6ec7f54" dependencies = [ "async-trait", "futures-core", "http 0.2.12", - "opentelemetry", + "opentelemetry 0.23.0", "opentelemetry-proto", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", + "opentelemetry_sdk 0.23.0", "prost", "thiserror", "tokio", @@ -3302,46 +3314,46 @@ dependencies = [ [[package]] name = "opentelemetry-prometheus" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bbcf6341cab7e2193e5843f0ac36c446a5b3fccb28747afaeda17996dcd02e" +checksum = "5e1a24eafe47b693cb938f8505f240dc26c71db60df9aca376b4f857e9653ec7" dependencies = [ "once_cell", - "opentelemetry", - "opentelemetry_sdk", + "opentelemetry 0.23.0", + "opentelemetry_sdk 0.23.0", "prometheus", "protobuf 2.28.0", ] [[package]] name = "opentelemetry-proto" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" +checksum = "984806e6cf27f2b49282e2a05e288f30594f3dbc74eb7a6e99422bc48ed78162" dependencies = [ - "opentelemetry", - "opentelemetry_sdk", + "opentelemetry 0.23.0", + "opentelemetry_sdk 0.23.0", "prost", "tonic", ] [[package]] name = "opentelemetry-semantic-conventions" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ab5bd6c42fb9349dcf28af2ba9a0667f697f9bdcca045d39f2cec5543e2910" +checksum = "1869fb4bb9b35c5ba8a1e40c9b128a7b4c010d07091e864a29da19e4fe2ca4d7" [[package]] name = "opentelemetry-stdout" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bdf28b381f23afcd150afc0b38a4183dd321fc96320c1554752b6b761648f78" +checksum = "d6d080bf06af02b738feb2e6830cf72c30b76ca18b40f555cdf1b53e7b491bfe" dependencies = [ "async-trait", "chrono", "futures-util", - "opentelemetry", - "opentelemetry_sdk", + "opentelemetry 0.23.0", + "opentelemetry_sdk 0.23.0", "ordered-float 4.2.0", "serde", "serde_json", @@ -3350,14 +3362,14 @@ dependencies = [ [[package]] name = "opentelemetry-system-metrics" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dca748d4fe59e208f6c71bde86573d326f98ed29696d31dbf7d2454b8f1af2d" +checksum = "0d4b02ba3fc9a6e17b9c6f892f3963224e126a5424360f3fc0fc24c90b109ba5" dependencies = [ "eyre", "indexmap 1.9.3", "nvml-wrapper", - "opentelemetry", + "opentelemetry 0.23.0", "sysinfo 0.29.11", "tracing", ] @@ -3368,7 +3380,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e90c7113be649e31e9a0f8b5ee24ed7a16923b322c3c5ab6367469c049d6b7e" dependencies = [ - "async-std", "async-trait", "crossbeam-channel", "futures-channel", @@ -3376,7 +3387,28 @@ dependencies = [ "futures-util", "glob", "once_cell", - "opentelemetry", + "opentelemetry 0.22.0", + "ordered-float 4.2.0", + "percent-encoding", + "rand", + "thiserror", +] + +[[package]] +name = "opentelemetry_sdk" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae312d58eaa90a82d2e627fd86e075cf5230b3f11794e2ed74199ebbe572d4fd" +dependencies = [ + "async-std", + "async-trait", + "futures-channel", + "futures-executor", + "futures-util", + "glob", + "lazy_static", + "once_cell", + "opentelemetry 0.23.0", "ordered-float 4.2.0", "percent-encoding", "rand", @@ -5091,7 +5123,7 @@ dependencies = [ "nom", "num_cpus", "once_cell", - "opentelemetry", + "opentelemetry 0.23.0", "opentelemetry-appender-tracing", "opentelemetry-http", "opentelemetry-otlp", @@ -5099,7 +5131,7 @@ dependencies = [ "opentelemetry-semantic-conventions", "opentelemetry-stdout", "opentelemetry-system-metrics", - "opentelemetry_sdk", + "opentelemetry_sdk 0.23.0", "phonenumber", "pretty_assertions", "prometheus", @@ -5141,7 +5173,7 @@ dependencies = [ "tonic", "tonic-types", "tracing", - "tracing-opentelemetry", + "tracing-opentelemetry 0.24.0", "tracing-subscriber", "ttl_cache", "update-informer", @@ -5280,11 +5312,11 @@ dependencies = [ "hyper 0.14.28", "hyper-util", "once_cell", - "opentelemetry", + "opentelemetry 0.23.0", "opentelemetry-http", "opentelemetry-otlp", "opentelemetry-semantic-conventions", - "opentelemetry_sdk", + "opentelemetry_sdk 0.23.0", "prost", "prost-types", "protoc-bin-vendored", @@ -5296,7 +5328,7 @@ dependencies = [ "tonic-tracing-opentelemetry", "tower", "tracing", - "tracing-opentelemetry", + "tracing-opentelemetry 0.24.0", "tracing-subscriber", ] @@ -5682,12 +5714,12 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", - "opentelemetry", + "opentelemetry 0.22.0", "pin-project-lite", "tonic", "tower", "tracing", - "tracing-opentelemetry", + "tracing-opentelemetry 0.23.0", ] [[package]] @@ -5785,8 +5817,26 @@ checksum = "a9be14ba1bbe4ab79e9229f7f89fab8d120b865859f10527f31c033e599d2284" dependencies = [ "js-sys", "once_cell", - "opentelemetry", - "opentelemetry_sdk", + "opentelemetry 0.22.0", + "opentelemetry_sdk 0.22.1", + "smallvec", + "tracing", + "tracing-core", + "tracing-log", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f68803492bf28ab40aeccaecc7021096bd256baf7ca77c3d425d89b35a7be4e4" +dependencies = [ + "js-sys", + "once_cell", + "opentelemetry 0.23.0", + "opentelemetry_sdk 0.23.0", "smallvec", "tracing", "tracing-core", diff --git a/Cargo.toml b/Cargo.toml index 7c204e752f..ef35da12a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,14 +41,14 @@ rustls = { version = "0.23.5", optional = true, features = [ ], default-features = false } rustls-pki-types = "1.5.0" inquire = { version = "0.7.5", optional = true } -opentelemetry-otlp = { version = "0.15.0", features = [ +opentelemetry-otlp = { version = "0.16.0", features = [ "trace", "logs", "metrics", # required to make grpc requests "tls-roots", ], optional = true } -opentelemetry-system-metrics = { version = "0.1.8", optional = true } +opentelemetry-system-metrics = { version = "0.1.9", optional = true } tailcall-http-cache = { path = "tailcall-http-cache", optional = true } tailcall-version = { path = "./tailcall-version", optional = true } @@ -114,25 +114,25 @@ tracing-subscriber = { version = "0.3.18", features = [ "fmt", "env-filter", ] } -tracing-opentelemetry = "0.23.0" +tracing-opentelemetry = "0.24.0" getrandom = { version = "0.2.14", features = ["js"] } prometheus = "0.13.4" tonic = { version = "0.11.0", default-features = false } -opentelemetry-semantic-conventions = "0.14.0" -opentelemetry = { version = "0.22.0", features = ["trace", "logs", "metrics"] } -opentelemetry_sdk = { version = "0.22.1", features = [ +opentelemetry-semantic-conventions = "0.15.0" +opentelemetry = { version = "0.23.0", features = ["trace", "logs", "metrics"] } +opentelemetry_sdk = { version = "0.23.0", features = [ "trace", "logs", "metrics", ] } -opentelemetry-http = "0.11.1" -opentelemetry-stdout = { version = "0.3.0", features = [ +opentelemetry-http = "0.12.0" +opentelemetry-stdout = { version = "0.4.0", features = [ "trace", "logs", "metrics", ] } -opentelemetry-appender-tracing = { version = "0.3.0" } -opentelemetry-prometheus = "0.15.0" +opentelemetry-appender-tracing = { version = "0.4.0" } +opentelemetry-prometheus = "0.16.0" phonenumber = "0.3.4" chrono = "0.4.38" async-graphql-extension-apollo-tracing = { version = "3.2.15" } diff --git a/src/cli/telemetry.rs b/src/cli/telemetry.rs index 05caeeaf5b..3b315b2ab7 100644 --- a/src/cli/telemetry.rs +++ b/src/cli/telemetry.rs @@ -130,7 +130,6 @@ fn set_logger_provider( .with_exporter(otlp_exporter(config)) .with_log_config(opentelemetry_sdk::logs::config().with_resource(RESOURCE.clone())) .install_batch(runtime::Tokio)? - .provider().clone() , // Prometheus works only with metrics TelemetryExporter::Prometheus(_) => return Ok(None), @@ -139,8 +138,6 @@ fn set_logger_provider( let otel_tracing_appender = OpenTelemetryTracingBridge::new(&provider); - global::set_logger_provider(provider); - Ok(Some(otel_tracing_appender)) } diff --git a/tailcall-upstream-grpc/Cargo.toml b/tailcall-upstream-grpc/Cargo.toml index f1d1e377ce..4a12c86112 100644 --- a/tailcall-upstream-grpc/Cargo.toml +++ b/tailcall-upstream-grpc/Cargo.toml @@ -19,17 +19,17 @@ http-body-util = "0.1.1" anyhow = "1.0.82" once_cell = "1.19.0" tonic-tracing-opentelemetry = "0.18.2" -opentelemetry = { version = "0.22.0", features = ["trace"] } -opentelemetry_sdk = { version = "0.22.1", features = ["trace", "rt-tokio"] } -opentelemetry-semantic-conventions = "0.14.0" -opentelemetry-http = "0.11.1" -opentelemetry-otlp = { version = "0.15.0", features = [ +opentelemetry = { version = "0.23.0", features = ["trace"] } +opentelemetry_sdk = { version = "0.23.0", features = ["trace", "rt-tokio"] } +opentelemetry-semantic-conventions = "0.15.0" +opentelemetry-http = "0.12.0" +opentelemetry-otlp = { version = "0.16.0", features = [ "trace", # required to make grpc requests "tls-roots", ] } tracing = "0.1.40" -tracing-opentelemetry = "0.23.0" +tracing-opentelemetry = "0.24.0" tracing-subscriber = "0.3.18" [build-dependencies]