From ea6d63a21ab03a58857f6c4ac765670485a4919f Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 8 Apr 2024 09:04:07 +0200 Subject: [PATCH 1/2] Fix conflict in meter name --- Cargo.lock | 89 +++++++++++-------- .../extensions/telemetry/metrics/Cargo.toml | 8 +- .../extensions/telemetry/metrics/src/lib.rs | 6 +- 3 files changed, 60 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3046121a..2f260d9ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -526,6 +526,28 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "async-task" version = "4.4.1" @@ -1581,10 +1603,10 @@ name = "dora-metrics" version = "0.3.2" dependencies = [ "eyre", - "opentelemetry 0.21.0", + "opentelemetry 0.22.0", "opentelemetry-otlp", "opentelemetry-system-metrics", - "opentelemetry_sdk 0.21.2", + "opentelemetry_sdk 0.22.1", ] [[package]] @@ -3657,13 +3679,12 @@ dependencies = [ [[package]] name = "opentelemetry" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" +checksum = "900d57987be3f2aeb70d385fff9b27fb74c5723cc9a52d904d4f9c807a0667bf" dependencies = [ "futures-core", "futures-sink", - "indexmap 2.0.2", "js-sys", "once_cell", "pin-project-lite", @@ -3690,17 +3711,17 @@ dependencies = [ [[package]] name = "opentelemetry-otlp" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f24cda83b20ed2433c68241f918d0f6fdec8b1d43b7a9590ab4420c5095ca930" +checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb" dependencies = [ "async-trait", "futures-core", "http", - "opentelemetry 0.21.0", + "opentelemetry 0.22.0", "opentelemetry-proto", - "opentelemetry-semantic-conventions 0.13.0", - "opentelemetry_sdk 0.21.2", + "opentelemetry-semantic-conventions 0.14.0", + "opentelemetry_sdk 0.22.1", "prost", "thiserror", "tokio", @@ -3709,12 +3730,12 @@ dependencies = [ [[package]] name = "opentelemetry-proto" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2e155ce5cc812ea3d1dffbd1539aed653de4bf4882d60e6e04dcf0901d674e1" +checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" dependencies = [ - "opentelemetry 0.21.0", - "opentelemetry_sdk 0.21.2", + "opentelemetry 0.22.0", + "opentelemetry_sdk 0.22.1", "prost", "tonic", ] @@ -3730,23 +3751,20 @@ dependencies = [ [[package]] name = "opentelemetry-semantic-conventions" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5774f1ef1f982ef2a447f6ee04ec383981a3ab99c8e77a1a7b30182e65bbc84" -dependencies = [ - "opentelemetry 0.21.0", -] +checksum = "f9ab5bd6c42fb9349dcf28af2ba9a0667f697f9bdcca045d39f2cec5543e2910" [[package]] name = "opentelemetry-system-metrics" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a4662d72a3d0cd5242067ba15da95bc4d83bce5151337ffcc971fc76d261455" +checksum = "1dca748d4fe59e208f6c71bde86573d326f98ed29696d31dbf7d2454b8f1af2d" dependencies = [ "eyre", "indexmap 1.9.3", "nvml-wrapper", - "opentelemetry 0.21.0", + "opentelemetry 0.22.0", "sysinfo", "tracing", ] @@ -3791,9 +3809,9 @@ dependencies = [ [[package]] name = "opentelemetry_sdk" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f16aec8a98a457a52664d69e0091bac3a0abd18ead9b641cb00202ba4e0efe4" +checksum = "9e90c7113be649e31e9a0f8b5ee24ed7a16923b322c3c5ab6367469c049d6b7e" dependencies = [ "async-trait", "crossbeam-channel", @@ -3802,7 +3820,7 @@ dependencies = [ "futures-util", "glob", "once_cell", - "opentelemetry 0.21.0", + "opentelemetry 0.22.0", "ordered-float 4.1.1", "percent-encoding", "rand", @@ -4259,9 +4277,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.9" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" dependencies = [ "bytes", "prost-derive", @@ -4269,15 +4287,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.11.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -5730,16 +5748,15 @@ dependencies = [ [[package]] name = "tonic" -version = "0.9.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ + "async-stream", "async-trait", "axum", "base64 0.21.4", "bytes", - "futures-core", - "futures-util", "h2", "http", "http-body", @@ -5875,7 +5892,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "static_assertions", ] diff --git a/libraries/extensions/telemetry/metrics/Cargo.toml b/libraries/extensions/telemetry/metrics/Cargo.toml index 62b509745..9a5b23991 100644 --- a/libraries/extensions/telemetry/metrics/Cargo.toml +++ b/libraries/extensions/telemetry/metrics/Cargo.toml @@ -9,8 +9,8 @@ license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -opentelemetry = { version = "0.21", features = ["metrics"] } -opentelemetry-otlp = { version = "0.14.0", features = ["tonic", "metrics"] } -opentelemetry_sdk = { version = "0.21", features = ["rt-tokio", "metrics"] } +opentelemetry = { version = "0.22.0", features = ["metrics"] } +opentelemetry-otlp = { version = "0.15.0", features = ["tonic", "metrics"] } +opentelemetry_sdk = { version = "0.22.0", features = ["rt-tokio", "metrics"] } eyre = "0.6.12" -opentelemetry-system-metrics = { version = "0.1.6" } +opentelemetry-system-metrics = { version = "0.1.8" } diff --git a/libraries/extensions/telemetry/metrics/src/lib.rs b/libraries/extensions/telemetry/metrics/src/lib.rs index d8f0bfaa0..a0c36667e 100644 --- a/libraries/extensions/telemetry/metrics/src/lib.rs +++ b/libraries/extensions/telemetry/metrics/src/lib.rs @@ -15,14 +15,14 @@ use std::time::Duration; use eyre::{Context, Result}; use opentelemetry::metrics::{self, MeterProvider as _}; use opentelemetry_otlp::{ExportConfig, WithExportConfig}; -use opentelemetry_sdk::{metrics::MeterProvider, runtime}; +use opentelemetry_sdk::{metrics::SdkMeterProvider, runtime}; use opentelemetry_system_metrics::init_process_observer; /// Init opentelemetry meter /// /// Use the default Opentelemetry exporter with default config /// TODO: Make Opentelemetry configurable /// -pub fn init_metrics() -> metrics::Result { +pub fn init_metrics() -> metrics::Result { let endpoint = std::env::var("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT") .unwrap_or_else(|_| "http://localhost:4317".to_string()); let export_config = ExportConfig { @@ -41,7 +41,7 @@ pub fn init_metrics() -> metrics::Result { .build() } -pub fn init_meter_provider(meter_id: String) -> Result { +pub fn init_meter_provider(meter_id: String) -> Result { let meter_provider = init_metrics().context("Could not create opentelemetry meter")?; let meter = meter_provider.meter(meter_id); let _ = init_process_observer(meter).context("could not initiale system metrics observer")?; From bf82a9762e07f572f918f60d36a91850189b2bf2 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 8 Apr 2024 09:09:01 +0200 Subject: [PATCH 2/2] Add a `--locked` in `README` install section in case of dependency issue not caught by cargo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb457c24b..300fa1b78 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ Feel free to reach out if you have any questions! Quickest way: ```bash -cargo install dora-cli -pip install dora-rs ## For Python API +cargo install dora-cli # In case of issues, you can try to add `--locked` +pip install dora-rs # For Python API dora --help ```