diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index e29cfa6e026d..b2147fa5cdff 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "6c7b38be0041b23941f8b9a21daa45ae6756432a86f8879b977d8b927787818e", + "checksum": "55c7a581cc8bbcdb86c093ec6b478c55a9b8b51e044d141966b31a354cfb9901", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -1096,14 +1096,14 @@ ], "license_file": "LICENSE-APACHE" }, - "actix-web-prom 0.9.0": { + "actix-web-prom 0.10.0": { "name": "actix-web-prom", - "version": "0.9.0", + "version": "0.10.0", "package_url": "https://github.com/nlopes/actix-web-prom.git", "repository": { "Http": { - "url": "https://static.crates.io/crates/actix-web-prom/0.9.0/download", - "sha256": "56a34f1825c3ae06567a9d632466809bbf34963c86002e8921b64f32d48d289d" + "url": "https://static.crates.io/crates/actix-web-prom/0.10.0/download", + "sha256": "a7eb266b4c692a4a7e68429fcbe4eb3bd55c053f6d84c0522dc83df22395edf6" } }, "targets": [ @@ -1144,7 +1144,7 @@ "target": "pin_project_lite" }, { - "id": "prometheus 0.13.4", + "id": "prometheus 0.14.0", "target": "prometheus" }, { @@ -1159,7 +1159,7 @@ "selects": {} }, "edition": "2021", - "version": "0.9.0" + "version": "0.10.0" }, "license": "MIT", "license_ids": [ @@ -21187,7 +21187,7 @@ "target": "actix_web" }, { - "id": "actix-web-prom 0.9.0", + "id": "actix-web-prom 0.10.0", "target": "actix_web_prom" }, { @@ -21962,7 +21962,7 @@ "target": "opentelemetry_otlp" }, { - "id": "opentelemetry-prometheus 0.13.0", + "id": "opentelemetry-prometheus 0.14.1", "target": "opentelemetry_prometheus" }, { @@ -22034,11 +22034,11 @@ "target": "proc_macro2" }, { - "id": "procfs 0.9.1", + "id": "procfs 0.17.0", "target": "procfs" }, { - "id": "prometheus 0.13.4", + "id": "prometheus 0.14.0", "target": "prometheus" }, { @@ -22063,7 +22063,7 @@ "target": "prost_build" }, { - "id": "protobuf 2.28.0", + "id": "protobuf 3.7.2", "target": "protobuf" }, { @@ -54134,69 +54134,6 @@ ], "license_file": "LICENSE" }, - "opentelemetry-prometheus 0.13.0": { - "name": "opentelemetry-prometheus", - "version": "0.13.0", - "package_url": "https://github.com/open-telemetry/opentelemetry-rust", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/opentelemetry-prometheus/0.13.0/download", - "sha256": "c7d81bc254e2d572120363a2b16cdb0d715d301b5789be0cfc26ad87e4e10e53" - } - }, - "targets": [ - { - "Library": { - "crate_name": "opentelemetry_prometheus", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "opentelemetry_prometheus", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "deps": { - "common": [ - { - "id": "once_cell 1.21.3", - "target": "once_cell" - }, - { - "id": "opentelemetry_api 0.20.0", - "target": "opentelemetry_api" - }, - { - "id": "opentelemetry_sdk 0.20.0", - "target": "opentelemetry_sdk" - }, - { - "id": "prometheus 0.13.4", - "target": "prometheus" - }, - { - "id": "protobuf 2.28.0", - "target": "protobuf" - } - ], - "selects": {} - }, - "edition": "2021", - "version": "0.13.0" - }, - "license": "Apache-2.0", - "license_ids": [ - "Apache-2.0" - ], - "license_file": "LICENSE" - }, "opentelemetry-prometheus 0.14.1": { "name": "opentelemetry-prometheus", "version": "0.14.1", @@ -54466,93 +54403,6 @@ ], "license_file": "LICENSE" }, - "opentelemetry_api 0.20.0": { - "name": "opentelemetry_api", - "version": "0.20.0", - "package_url": "https://github.com/open-telemetry/opentelemetry-rust", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/opentelemetry_api/0.20.0/download", - "sha256": "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" - } - }, - "targets": [ - { - "Library": { - "crate_name": "opentelemetry_api", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "opentelemetry_api", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "crate_features": { - "common": [ - "default", - "metrics", - "pin-project-lite", - "trace" - ], - "selects": {} - }, - "deps": { - "common": [ - { - "id": "futures-channel 0.3.31", - "target": "futures_channel" - }, - { - "id": "futures-util 0.3.31", - "target": "futures_util" - }, - { - "id": "indexmap 1.9.3", - "target": "indexmap" - }, - { - "id": "once_cell 1.21.3", - "target": "once_cell" - }, - { - "id": "pin-project-lite 0.2.16", - "target": "pin_project_lite" - }, - { - "id": "thiserror 1.0.68", - "target": "thiserror" - }, - { - "id": "urlencoding 2.1.3", - "target": "urlencoding" - } - ], - "selects": { - "cfg(all(target_arch = \"wasm32\", not(target_os = \"wasi\")))": [ - { - "id": "js-sys 0.3.77", - "target": "js_sys" - } - ] - } - }, - "edition": "2021", - "version": "0.20.0" - }, - "license": "Apache-2.0", - "license_ids": [ - "Apache-2.0" - ], - "license_file": "LICENSE" - }, "opentelemetry_sdk 0.18.0": { "name": "opentelemetry_sdk", "version": "0.18.0", @@ -54652,98 +54502,6 @@ ], "license_file": "LICENSE" }, - "opentelemetry_sdk 0.20.0": { - "name": "opentelemetry_sdk", - "version": "0.20.0", - "package_url": "https://github.com/open-telemetry/opentelemetry-rust", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/opentelemetry_sdk/0.20.0/download", - "sha256": "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" - } - }, - "targets": [ - { - "Library": { - "crate_name": "opentelemetry_sdk", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "opentelemetry_sdk", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "crate_features": { - "common": [ - "async-trait", - "metrics", - "regex" - ], - "selects": {} - }, - "deps": { - "common": [ - { - "id": "futures-channel 0.3.31", - "target": "futures_channel" - }, - { - "id": "futures-executor 0.3.31", - "target": "futures_executor" - }, - { - "id": "futures-util 0.3.31", - "target": "futures_util" - }, - { - "id": "once_cell 1.21.3", - "target": "once_cell" - }, - { - "id": "opentelemetry_api 0.20.0", - "target": "opentelemetry_api" - }, - { - "id": "ordered-float 3.9.2", - "target": "ordered_float" - }, - { - "id": "regex 1.12.2", - "target": "regex" - }, - { - "id": "thiserror 1.0.68", - "target": "thiserror" - } - ], - "selects": {} - }, - "edition": "2021", - "proc_macro_deps": { - "common": [ - { - "id": "async-trait 0.1.89", - "target": "async_trait" - } - ], - "selects": {} - }, - "version": "0.20.0" - }, - "license": "Apache-2.0", - "license_ids": [ - "Apache-2.0" - ], - "license_file": "LICENSE" - }, "opentelemetry_sdk 0.21.2": { "name": "opentelemetry_sdk", "version": "0.21.2", @@ -55021,60 +54779,6 @@ ], "license_file": "LICENSE.txt" }, - "ordered-float 3.9.2": { - "name": "ordered-float", - "version": "3.9.2", - "package_url": "https://github.com/reem/rust-ordered-float", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/ordered-float/3.9.2/download", - "sha256": "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" - } - }, - "targets": [ - { - "Library": { - "crate_name": "ordered_float", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "ordered_float", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "crate_features": { - "common": [ - "default", - "std" - ], - "selects": {} - }, - "deps": { - "common": [ - { - "id": "num-traits 0.2.19", - "target": "num_traits" - } - ], - "selects": {} - }, - "edition": "2021", - "version": "3.9.2" - }, - "license": "MIT", - "license_ids": [ - "MIT" - ], - "license_file": "LICENSE-MIT" - }, "ordered-float 4.2.0": { "name": "ordered-float", "version": "4.2.0", @@ -60580,14 +60284,14 @@ ], "license_file": "LICENSE-APACHE" }, - "procfs 0.9.1": { + "procfs 0.16.0": { "name": "procfs", - "version": "0.9.1", + "version": "0.16.0", "package_url": "https://github.com/eminence/procfs", "repository": { "Http": { - "url": "https://static.crates.io/crates/procfs/0.9.1/download", - "sha256": "ab8809e0c18450a2db0f236d2a44ec0b4c1412d0eb936233579f0990faa5d5cd" + "url": "https://static.crates.io/crates/procfs/0.16.0/download", + "sha256": "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" } }, "targets": [ @@ -60602,6 +60306,18 @@ ] } } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } } ], "library_target_name": "procfs", @@ -60612,17 +60328,9 @@ "deps": { "common": [ { - "id": "bitflags 1.3.2", + "id": "bitflags 2.10.0", "target": "bitflags" }, - { - "id": "byteorder 1.5.0", - "target": "byteorder" - }, - { - "id": "flate2 1.1.5", - "target": "flate2" - }, { "id": "hex 0.4.3", "target": "hex" @@ -60632,30 +60340,49 @@ "target": "lazy_static" }, { - "id": "libc 0.2.177", - "target": "libc" + "id": "procfs 0.16.0", + "target": "build_script_build" + }, + { + "id": "procfs-core 0.16.0", + "target": "procfs_core" + }, + { + "id": "rustix 0.38.44", + "target": "rustix" } ], "selects": {} }, "edition": "2018", - "version": "0.9.1" + "version": "0.16.0" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "compile_data_glob_excludes": [ + "**/*.rs" + ], + "data_glob": [ + "**" + ] }, "license": "MIT OR Apache-2.0", "license_ids": [ "Apache-2.0", "MIT" ], - "license_file": "LICENSE-APACHE" + "license_file": null }, - "procfs 0.16.0": { + "procfs 0.17.0": { "name": "procfs", - "version": "0.16.0", + "version": "0.17.0", "package_url": "https://github.com/eminence/procfs", "repository": { "Http": { - "url": "https://static.crates.io/crates/procfs/0.16.0/download", - "sha256": "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" + "url": "https://static.crates.io/crates/procfs/0.17.0/download", + "sha256": "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" } }, "targets": [ @@ -60700,15 +60427,11 @@ "target": "hex" }, { - "id": "lazy_static 1.5.0", - "target": "lazy_static" - }, - { - "id": "procfs 0.16.0", + "id": "procfs 0.17.0", "target": "build_script_build" }, { - "id": "procfs-core 0.16.0", + "id": "procfs-core 0.17.0", "target": "procfs_core" }, { @@ -60719,7 +60442,7 @@ "selects": {} }, "edition": "2018", - "version": "0.16.0" + "version": "0.17.0" }, "build_script_attrs": { "compile_data_glob": [ @@ -60737,7 +60460,7 @@ "Apache-2.0", "MIT" ], - "license_file": null + "license_file": "LICENSE-APACHE" }, "procfs-core 0.16.0": { "name": "procfs-core", @@ -60791,6 +60514,58 @@ ], "license_file": null }, + "procfs-core 0.17.0": { + "name": "procfs-core", + "version": "0.17.0", + "package_url": "https://github.com/eminence/procfs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/procfs-core/0.17.0/download", + "sha256": "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" + } + }, + "targets": [ + { + "Library": { + "crate_name": "procfs_core", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "procfs_core", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "bitflags 2.10.0", + "target": "bitflags" + }, + { + "id": "hex 0.4.3", + "target": "hex" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.17.0" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, "prometheus 0.13.4": { "name": "prometheus", "version": "0.13.4", @@ -60960,6 +60735,9 @@ "crate_features": { "common": [ "default", + "libc", + "process", + "procfs", "protobuf" ], "selects": {} @@ -60978,6 +60756,10 @@ "id": "lazy_static 1.5.0", "target": "lazy_static" }, + { + "id": "libc 0.2.177", + "target": "libc" + }, { "id": "memchr 2.7.4", "target": "memchr" @@ -60999,7 +60781,20 @@ "target": "thiserror" } ], - "selects": {} + "selects": { + "aarch64-unknown-linux-gnu": [ + { + "id": "procfs 0.17.0", + "target": "procfs" + } + ], + "x86_64-unknown-linux-gnu": [ + { + "id": "procfs 0.17.0", + "target": "procfs" + } + ] + } }, "edition": "2018", "version": "0.14.0" @@ -69053,57 +68848,45 @@ "crate_features": { "common": [ "alloc", + "default", "fs", "libc-extra-traits", "net", - "std" + "param", + "process", + "std", + "system", + "thread", + "use-libc-auxv" ], "selects": { "aarch64-apple-darwin": [ - "default", "event", "pipe", - "process", "stdio", "termios", - "time", - "use-libc-auxv" + "time" ], "aarch64-unknown-linux-gnu": [ - "default", "event", - "param", "pipe", - "process", "stdio", - "system", "termios", - "thread", - "time", - "use-libc-auxv" + "time" ], "x86_64-apple-darwin": [ - "default", "event", "pipe", - "process", "stdio", "termios", - "time", - "use-libc-auxv" + "time" ], "x86_64-unknown-linux-gnu": [ - "default", "event", - "param", "pipe", - "process", "stdio", - "system", "termios", - "thread", - "time", - "use-libc-auxv" + "time" ] } }, @@ -98576,7 +98359,7 @@ "direct_deps": [ "actix-rt 2.10.0", "actix-web 4.9.0", - "actix-web-prom 0.9.0", + "actix-web-prom 0.10.0", "addr 0.15.6", "aide 0.14.2", "anyhow 1.0.100", @@ -98775,7 +98558,7 @@ "openssh-keys 0.5.0", "opentelemetry 0.27.0", "opentelemetry-otlp 0.27.0", - "opentelemetry-prometheus 0.13.0", + "opentelemetry-prometheus 0.14.1", "opentelemetry_sdk 0.27.1", "p256 0.13.2", "p384 0.13.1", @@ -98794,15 +98577,15 @@ "pretty_assertions 1.4.0", "priority-queue 1.3.2", "proc-macro2 1.0.103", - "procfs 0.9.1", - "prometheus 0.13.4", + "procfs 0.17.0", + "prometheus 0.14.0", "prometheus-parse 0.2.4", "proptest 1.5.0", "proptest-derive 0.5.0", "prost 0.12.2", "prost 0.13.3", "prost-build 0.13.3", - "protobuf 2.28.0", + "protobuf 3.7.2", "publicsuffix 2.2.3", "qrcode 0.14.1", "quickcheck 1.0.3", diff --git a/Cargo.Bazel.toml.lock b/Cargo.Bazel.toml.lock index 9d0f0a68cc2a..4ad4a48a4850 100644 --- a/Cargo.Bazel.toml.lock +++ b/Cargo.Bazel.toml.lock @@ -220,15 +220,15 @@ dependencies = [ [[package]] name = "actix-web-prom" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a34f1825c3ae06567a9d632466809bbf34963c86002e8921b64f32d48d289d" +checksum = "a7eb266b4c692a4a7e68429fcbe4eb3bd55c053f6d84c0522dc83df22395edf6" dependencies = [ "actix-web", "futures-core", "log", "pin-project-lite", - "prometheus 0.13.4", + "prometheus 0.14.0", "regex", "strfmt", ] @@ -1068,7 +1068,7 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "opentelemetry 0.21.0", - "opentelemetry-prometheus 0.14.1", + "opentelemetry-prometheus", "opentelemetry-semantic-conventions", "opentelemetry_sdk 0.21.2", "pin-project-lite", @@ -3787,7 +3787,7 @@ dependencies = [ "openssh-keys", "opentelemetry 0.27.0", "opentelemetry-otlp", - "opentelemetry-prometheus 0.13.0", + "opentelemetry-prometheus", "opentelemetry_sdk 0.27.1", "p256", "p384", @@ -3806,15 +3806,15 @@ dependencies = [ "pretty_assertions", "priority-queue", "proc-macro2", - "procfs 0.9.1", - "prometheus 0.13.4", + "procfs 0.17.0", + "prometheus 0.14.0", "prometheus-parse", "proptest", "proptest-derive", "prost 0.12.2", "prost 0.13.3", "prost-build 0.13.3", - "protobuf 2.28.0", + "protobuf 3.7.2", "publicsuffix", "qrcode", "quickcheck", @@ -9188,7 +9188,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69d6c3d7288a106c0a363e4b0e8d308058d56902adefb16f4936f417ffef086e" dependencies = [ - "opentelemetry_api 0.18.0", + "opentelemetry_api", "opentelemetry_sdk 0.18.0", ] @@ -9241,19 +9241,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "opentelemetry-prometheus" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d81bc254e2d572120363a2b16cdb0d715d301b5789be0cfc26ad87e4e10e53" -dependencies = [ - "once_cell", - "opentelemetry_api 0.20.0", - "opentelemetry_sdk 0.20.0", - "prometheus 0.13.4", - "protobuf 2.28.0", -] - [[package]] name = "opentelemetry-prometheus" version = "0.14.1" @@ -9303,22 +9290,6 @@ dependencies = [ "thiserror 1.0.68", ] -[[package]] -name = "opentelemetry_api" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" -dependencies = [ - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror 1.0.68", - "urlencoding", -] - [[package]] name = "opentelemetry_sdk" version = "0.18.0" @@ -9331,29 +9302,12 @@ dependencies = [ "futures-executor", "futures-util", "once_cell", - "opentelemetry_api 0.18.0", + "opentelemetry_api", "percent-encoding", "rand 0.8.5", "thiserror 1.0.68", ] -[[package]] -name = "opentelemetry_sdk" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" -dependencies = [ - "async-trait", - "futures-channel", - "futures-executor", - "futures-util", - "once_cell", - "opentelemetry_api 0.20.0", - "ordered-float 3.9.2", - "regex", - "thiserror 1.0.68", -] - [[package]] name = "opentelemetry_sdk" version = "0.21.2" @@ -9368,7 +9322,7 @@ dependencies = [ "glob", "once_cell", "opentelemetry 0.21.0", - "ordered-float 4.2.0", + "ordered-float", "percent-encoding", "rand 0.8.5", "thiserror 1.0.68", @@ -9403,15 +9357,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "ordered-float" -version = "3.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" -dependencies = [ - "num-traits", -] - [[package]] name = "ordered-float" version = "4.2.0" @@ -10321,28 +10266,26 @@ dependencies = [ [[package]] name = "procfs" -version = "0.9.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8809e0c18450a2db0f236d2a44ec0b4c1412d0eb936233579f0990faa5d5cd" +checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 1.3.2", - "byteorder", - "flate2", + "bitflags 2.10.0", "hex", "lazy_static", - "libc", + "procfs-core 0.16.0", + "rustix 0.38.44", ] [[package]] name = "procfs" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ "bitflags 2.10.0", "hex", - "lazy_static", - "procfs-core", + "procfs-core 0.17.0", "rustix 0.38.44", ] @@ -10356,6 +10299,16 @@ dependencies = [ "hex", ] +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags 2.10.0", + "hex", +] + [[package]] name = "prometheus" version = "0.13.4" @@ -10382,8 +10335,10 @@ dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", + "libc", "memchr", "parking_lot 0.12.5", + "procfs 0.17.0", "protobuf 3.7.2", "thiserror 2.0.17", ] @@ -14807,7 +14762,7 @@ dependencies = [ "lalrpop 0.22.1", "lz4_flex", "nom-language", - "ordered-float 4.2.0", + "ordered-float", "regex", "serde", "serde_json", diff --git a/Cargo.lock b/Cargo.lock index 5721671df0dd..45a1be6a19a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -219,15 +219,15 @@ dependencies = [ [[package]] name = "actix-web-prom" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a34f1825c3ae06567a9d632466809bbf34963c86002e8921b64f32d48d289d" +checksum = "a7eb266b4c692a4a7e68429fcbe4eb3bd55c053f6d84c0522dc83df22395edf6" dependencies = [ "actix-web", "futures-core", "log", "pin-project-lite", - "prometheus 0.13.4", + "prometheus", "regex", "strfmt", ] @@ -2219,7 +2219,7 @@ dependencies = [ "leb128", "mockall", "pem 3.0.6", - "prometheus 0.13.4", + "prometheus", "rcgen 0.13.2", "reqwest 0.12.24", "serde", @@ -2252,7 +2252,7 @@ dependencies = [ "ic-stable-structures 0.6.8", "mockall", "priority-queue", - "prometheus 0.13.4", + "prometheus", "publicsuffix", "serde", "serde_cbor", @@ -6346,8 +6346,8 @@ dependencies = [ "hyper-util", "ic-adapter-metrics-service", "ic-http-endpoints-async-utils", - "prometheus 0.13.4", - "protobuf 2.28.0", + "prometheus", + "protobuf", "slog", "tokio", "tonic 0.12.3", @@ -6362,7 +6362,7 @@ dependencies = [ "ic-adapter-metrics-service", "ic-logger", "ic-metrics", - "protobuf 2.28.0", + "protobuf", "slog", "tokio", "tonic 0.12.3", @@ -6588,7 +6588,7 @@ dependencies = [ "ic-types-test-utils", "mockall", "phantom_newtype", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rand 0.8.5", "slog", @@ -6613,7 +6613,7 @@ dependencies = [ "ic-protobuf", "ic-test-utilities", "ic-types", - "prometheus 0.13.4", + "prometheus", "tokio", "tokio-stream", "tracing", @@ -6648,7 +6648,7 @@ dependencies = [ "lmdb-rkv", "lmdb-rkv-sys", "nix 0.24.3", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rand 0.8.5", "rocksdb", @@ -6795,7 +6795,7 @@ dependencies = [ "moka", "nix 0.30.1", "ppp", - "prometheus 0.14.0", + "prometheus", "prost 0.14.1", "prost-types 0.14.1", "rand 0.8.5", @@ -6861,7 +6861,7 @@ dependencies = [ "ic-agent 0.44.3", "instant-acme 0.8.4", "parse-size", - "prometheus 0.14.0", + "prometheus", "rcgen 0.14.5", "reqwest 0.12.24", "rustls 0.23.27", @@ -7050,7 +7050,7 @@ dependencies = [ "lmdb-rkv", "parking_lot", "primitive-types", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rand 0.8.5", "scrypt", @@ -7081,7 +7081,7 @@ dependencies = [ "ic-interfaces-adapter-client", "ic-logger", "ic-metrics", - "prometheus 0.13.4", + "prometheus", "serde", "serde_bytes", "slog", @@ -7165,7 +7165,7 @@ dependencies = [ "ic-test-utilities-types", "ic-types", "mockall", - "prometheus 0.13.4", + "prometheus", "proptest", "prost 0.13.4", "slog", @@ -7340,7 +7340,7 @@ dependencies = [ "num-traits", "object 0.37.3", "once_cell", - "prometheus 0.13.4", + "prometheus", "rand 0.8.5", "rayon", "regex", @@ -7912,7 +7912,7 @@ dependencies = [ "mockall", "num-traits", "phantom_newtype", - "prometheus 0.13.4", + "prometheus", "proptest", "prost 0.13.4", "rand 0.8.5", @@ -7951,7 +7951,7 @@ dependencies = [ "ic-test-utilities-types", "ic-types", "ic-types-test-utils", - "prometheus 0.13.4", + "prometheus", "slog", "strum_macros 0.26.4", "tokio", @@ -8005,7 +8005,7 @@ dependencies = [ "ic-test-utilities-state", "ic-test-utilities-types", "ic-types", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rayon", "slog", @@ -8049,7 +8049,7 @@ dependencies = [ "ic-types", "ic-types-test-utils", "phantom_newtype", - "prometheus 0.13.4", + "prometheus", "rand 0.8.5", "rayon", "slog", @@ -8077,7 +8077,7 @@ dependencies = [ "ic-types-test-utils", "mockall", "phantom_newtype", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rand 0.8.5", "slog", @@ -8138,7 +8138,7 @@ dependencies = [ "ic-test-utilities-time", "ic-test-utilities-types", "ic-types", - "prometheus 0.13.4", + "prometheus", "rand 0.8.5", "slog", ] @@ -8172,7 +8172,7 @@ dependencies = [ "ic-types", "ic-types-test-utils", "num-traits", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rayon", "slog", @@ -8647,7 +8647,7 @@ version = "0.9.0" dependencies = [ "convert_case 0.6.0", "ic-metrics", - "prometheus 0.13.4", + "prometheus", "strum 0.26.3", "strum_macros 0.26.4", ] @@ -9398,7 +9398,7 @@ dependencies = [ "ic-bn-lib-common", "ic-custom-domains-base", "ic-custom-domains-canister-client", - "prometheus 0.14.0", + "prometheus", "serde", "serde_json", "strum 0.27.2", @@ -9432,7 +9432,7 @@ dependencies = [ "ic-custom-domains-canister-api", "mockall", "pem 3.0.6", - "prometheus 0.14.0", + "prometheus", "serde", "strum 0.27.2", "thiserror 2.0.17", @@ -9495,7 +9495,7 @@ dependencies = [ "ic-test-utilities-state", "ic-test-utilities-types", "ic-types", - "prometheus 0.13.4", + "prometheus", "serde", "slog", ] @@ -9640,7 +9640,7 @@ dependencies = [ "nix 0.24.3", "num-traits", "pretty_assertions", - "prometheus 0.13.4", + "prometheus", "proptest", "rayon", "rustc-demangle", @@ -9762,7 +9762,7 @@ dependencies = [ "num-rational 0.2.4", "num-traits", "phantom_newtype", - "prometheus 0.13.4", + "prometheus", "proptest", "rand 0.8.5", "regex-lite", @@ -9845,7 +9845,7 @@ dependencies = [ "lazy_static", "maxminddb 0.26.0", "moka", - "prometheus 0.14.0", + "prometheus", "rand 0.8.5", "regex", "reqwest 0.12.24", @@ -9878,7 +9878,7 @@ dependencies = [ "candid", "ic-heap-bytes-derive", "paste", - "prometheus 0.13.4", + "prometheus", "tempfile", ] @@ -9945,7 +9945,7 @@ dependencies = [ "ic-http-endpoints-async-utils", "ic-metrics", "ic-test-utilities-logger", - "prometheus 0.13.4", + "prometheus", "reqwest 0.12.24", "slog", "thiserror 2.0.17", @@ -10019,7 +10019,7 @@ dependencies = [ "maplit", "mockall", "pretty_assertions", - "prometheus 0.13.4", + "prometheus", "proptest", "prost 0.13.4", "rand 0.8.5", @@ -10084,7 +10084,7 @@ dependencies = [ "ic-test-utilities-types", "ic-types", "maplit", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "reqwest 0.12.24", "serde", @@ -10166,7 +10166,7 @@ dependencies = [ "ic-metrics", "once_cell", "parking_lot", - "prometheus 0.13.4", + "prometheus", "rand 0.8.5", "rstest", "rustls 0.23.27", @@ -10206,7 +10206,7 @@ dependencies = [ "ic-test-utilities-time", "ic-test-utilities-types", "ic-types", - "prometheus 0.13.4", + "prometheus", "slog", "tokio", "tonic 0.12.3", @@ -10245,7 +10245,7 @@ dependencies = [ "ic-types", "ic-utils 0.9.0", "mockall", - "prometheus 0.13.4", + "prometheus", "proptest", "rand 0.8.5", "rand_chacha 0.3.1", @@ -10748,7 +10748,7 @@ dependencies = [ "ic-types", "ic-validator", "pprof", - "prometheus 0.13.4", + "prometheus", "proptest", "rand 0.8.5", "slog", @@ -11273,7 +11273,7 @@ dependencies = [ "messaging-test-utils", "mockall", "pretty_assertions", - "prometheus 0.13.4", + "prometheus", "proptest", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11291,8 +11291,8 @@ dependencies = [ "ic-logger", "libc", "parking_lot", - "procfs 0.9.1", - "prometheus 0.13.4", + "procfs", + "prometheus", "slog", "tokio", "tokio-metrics", @@ -12053,7 +12053,7 @@ dependencies = [ "ic-test-utilities-types", "ic-types", "pprof", - "prometheus 0.13.4", + "prometheus", "rand 0.8.5", "rcgen 0.13.2", "rustls 0.23.27", @@ -12717,7 +12717,7 @@ dependencies = [ "ic-test-utilities-logger", "ic-test-utilities-registry", "ic-types-test-utils", - "prometheus 0.13.4", + "prometheus", "serde", "slog", "tokio", @@ -12839,7 +12839,7 @@ dependencies = [ "ic-test-utilities-state", "ic-types", "ic-types-test-utils", - "prometheus 0.13.4", + "prometheus", "slog", ] @@ -12886,7 +12886,7 @@ dependencies = [ "ic-test-utilities-logger", "ic-types-test-utils", "phantom_newtype", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "quinn", "rstest", @@ -13053,7 +13053,7 @@ dependencies = [ "ic-test-utilities-metrics", "ic-types", "ic-utils-thread", - "prometheus 0.13.4", + "prometheus", ] [[package]] @@ -13279,7 +13279,7 @@ dependencies = [ "ic-types", "ic-types-test-utils", "pocket-ic", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rand 0.8.5", "slog", @@ -13479,7 +13479,7 @@ dependencies = [ "num_cpus", "pprof", "predicates", - "prometheus 0.13.4", + "prometheus", "rand 0.8.5", "regex", "slog", @@ -13628,7 +13628,7 @@ dependencies = [ "nix 0.24.3", "num-traits", "phantom_newtype", - "prometheus 0.13.4", + "prometheus", "proptest", "prost 0.13.4", "rand 0.8.5", @@ -13728,7 +13728,7 @@ dependencies = [ "num-traits", "on_wire", "pocket-ic", - "prometheus 0.13.4", + "prometheus", "proptest", "prost 0.13.4", "rand 0.8.5", @@ -14539,7 +14539,7 @@ dependencies = [ "ic-wasm-types", "itertools 0.12.1", "libc", - "prometheus 0.13.4", + "prometheus", "proptest", "prost 0.13.4", "scoped_threadpool", @@ -14676,7 +14676,7 @@ dependencies = [ "maplit", "nix 0.24.3", "parking_lot", - "prometheus 0.13.4", + "prometheus", "proptest", "prost 0.13.4", "rand 0.8.5", @@ -14714,7 +14714,7 @@ dependencies = [ "ic-types", "ic-types-test-utils", "mockall", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "rand 0.8.5", "slog", @@ -15081,7 +15081,7 @@ dependencies = [ "ic-wasm-types", "maplit", "num-traits", - "prometheus 0.13.4", + "prometheus", "strum 0.26.3", "strum_macros 0.26.4", "tempfile", @@ -15129,7 +15129,7 @@ name = "ic-test-utilities-metrics" version = "0.9.0" dependencies = [ "ic-metrics", - "prometheus 0.13.4", + "prometheus", ] [[package]] @@ -15823,7 +15823,7 @@ dependencies = [ "maplit", "mockall", "nix 0.24.3", - "prometheus 0.13.4", + "prometheus", "proptest", "rand 0.8.5", "reqwest 0.12.24", @@ -19255,7 +19255,7 @@ dependencies = [ "indoc 1.0.9", "mockall", "nix 0.24.3", - "prometheus 0.13.4", + "prometheus", "prost 0.13.4", "qrcode", "rand 0.8.5", @@ -20018,7 +20018,7 @@ dependencies = [ "libc", "nix 0.29.0", "pocket-ic", - "prometheus 0.13.4", + "prometheus", "rand 0.8.5", "rcgen 0.13.2", "registry-canister", @@ -20336,59 +20336,26 @@ dependencies = [ [[package]] name = "procfs" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8809e0c18450a2db0f236d2a44ec0b4c1412d0eb936233579f0990faa5d5cd" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "chrono", - "flate2", - "hex", - "lazy_static", - "libc", -] - -[[package]] -name = "procfs" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ "bitflags 2.10.0", "hex", - "lazy_static", "procfs-core", "rustix 0.38.44", ] [[package]] name = "procfs-core" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ "bitflags 2.10.0", "hex", ] -[[package]] -name = "prometheus" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" -dependencies = [ - "cfg-if", - "fnv", - "lazy_static", - "libc", - "memchr", - "parking_lot", - "procfs 0.16.0", - "protobuf 2.28.0", - "thiserror 1.0.69", -] - [[package]] name = "prometheus" version = "0.14.0" @@ -20398,9 +20365,11 @@ dependencies = [ "cfg-if", "fnv", "lazy_static", + "libc", "memchr", "parking_lot", - "protobuf 3.7.2", + "procfs", + "protobuf", "thiserror 2.0.17", ] @@ -20584,12 +20553,6 @@ dependencies = [ "prost 0.14.1", ] -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - [[package]] name = "protobuf" version = "3.7.2" @@ -21100,7 +21063,7 @@ dependencies = [ "ic-nns-constants", "ic-stable-structures 0.6.8", "mockall", - "prometheus 0.13.4", + "prometheus", "rand_chacha 0.3.1", "rate-limit-canister-integration-tests", "rate-limits-api", @@ -21818,7 +21781,7 @@ dependencies = [ "icrc-ledger-types", "lazy_static", "num-bigint 0.4.6", - "prometheus 0.13.4", + "prometheus", "serde", "serde_bytes", "serde_json", @@ -22373,7 +22336,7 @@ dependencies = [ "ic-http-types", "ic-nns-constants", "ic-stable-structures 0.6.8", - "prometheus 0.13.4", + "prometheus", "salt-sharing-api", "serde", "serde_cbor", @@ -25473,7 +25436,7 @@ dependencies = [ "anyhow", "ic-http-utils", "mockall", - "procfs 0.9.1", + "procfs", "reqwest 0.12.24", "rusb", "serde", diff --git a/Cargo.toml b/Cargo.toml index 048589596cbb..10cd299c29f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -582,7 +582,7 @@ opt-level = 3 [workspace.dependencies] actix-rt = "2.10.0" actix-web = "4.9.0" -actix-web-prom = "0.9.0" +actix-web-prom = "0.10.0" aide = { version = "^0.14.2", features = ["axum", "axum-json"] } anyhow = "1.0.93" arbitrary = { version = "1.3.2", features = ["derive"] } @@ -766,15 +766,15 @@ pprof = { version = "0.14.0", default-features = false, features = [ ] } predicates = "3.1.2" pretty_assertions = "1.4.0" -procfs = { version = "^0.9" } +procfs = { version = "^0.17", default-features = false } proc-macro2 = "1.0.89" -prometheus = { version = "0.13.4", features = ["process"] } +prometheus = { version = "0.14.0", features = ["process"] } prometheus-parse = { version = "0.2.4" } proptest = "1.5.0" proptest-derive = "0.5.0" prost = "0.13.3" prost-build = "0.13.3" -protobuf = "2.28.0" +protobuf = "3.7.2" ring = { version = "^0.17.7", features = ["std"] } qrcode = { version = "0.14.1", default-features = false } quinn = { version = "0.11.5", default-features = false, features = [ diff --git a/bazel/rust.MODULE.bazel b/bazel/rust.MODULE.bazel index 4fe09e953c8d..0f9625401b4c 100644 --- a/bazel/rust.MODULE.bazel +++ b/bazel/rust.MODULE.bazel @@ -42,7 +42,7 @@ crate.spec( ) crate.spec( package = "actix-web-prom", - version = "0.9.0", + version = "0.10.0", ) crate.spec( default_features = False, @@ -1045,7 +1045,7 @@ crate.spec( ) crate.spec( package = "opentelemetry-prometheus", - version = "^0.13.0", + version = "^0.14.1", ) crate.spec( default_features = False, @@ -1142,14 +1142,14 @@ crate.spec( crate.spec( default_features = False, package = "procfs", - version = "^0.9", + version = "^0.17.0", ) crate.spec( features = [ "process", ], package = "prometheus", - version = "^0.13.4", + version = "^0.14.0", ) crate.spec( package = "proptest", @@ -1180,7 +1180,7 @@ crate.spec( ) crate.spec( package = "protobuf", - version = "^2.28.0", + version = "^3.7.2", ) crate.spec( package = "publicsuffix", diff --git a/rs/artifact_pool/src/consensus_pool.rs b/rs/artifact_pool/src/consensus_pool.rs index 47a96a3e99d1..03e49d08d404 100644 --- a/rs/artifact_pool/src/consensus_pool.rs +++ b/rs/artifact_pool/src/consensus_pool.rs @@ -1561,16 +1561,16 @@ mod tests { prometheus::default_registry() .gather() .iter() - .find(|m| m.get_name() == "artifact_pool_consensus_count_per_height") + .find(|m| m.name() == "artifact_pool_consensus_count_per_height") .expect("articact_pool_consensus_count_per_heigfht metric not registered") .get_metric() .iter() .find(|m| m.get_label().iter().any(|label| { - label.get_name() == "pool_type" && label.get_value() == "validated" + label.name() == "pool_type" && label.value() == "validated" }) && m.get_label().iter().any(|label| { - label.get_name() == "type" && label.get_value() == "notarization" + label.name() == "type" && label.value() == "notarization" })) .expect( "metric with pool_type = unvalidated and type = notarization not registered", diff --git a/rs/crypto/internal/logmon/src/metrics.rs b/rs/crypto/internal/logmon/src/metrics.rs index d5005f5f16bd..0482d189e7f4 100644 --- a/rs/crypto/internal/logmon/src/metrics.rs +++ b/rs/crypto/internal/logmon/src/metrics.rs @@ -10,8 +10,7 @@ use prometheus::{ }; use std::ops::Add; use std::time::Instant; -use strum::IntoEnumIterator; -use strum_macros::EnumIter; +use strum::{AsRefStr, EnumIter, IntoEnumIterator}; #[cfg(test)] use strum_macros::IntoStaticStr; @@ -241,15 +240,12 @@ impl CryptoMetrics { start_time: Option, ) { if let Some(metrics) = &self.metrics { - let service_type_string = &format!("{service_type}"); - let message_type_string = &format!("{message_type}"); - let domain_string = &format!("{domain}"); metrics .crypto_vault_message_sizes .with_label_values(&[ - service_type_string, - message_type_string, - domain_string, + service_type.as_ref(), + message_type.as_ref(), + domain.as_ref(), method_name, ]) .observe(message_size as f64); @@ -258,9 +254,9 @@ impl CryptoMetrics { metrics .crypto_vault_message_serialization_duration_seconds .with_label_values(&[ - service_type_string, - message_type_string, - domain_string, + service_type.as_ref(), + message_type.as_ref(), + domain.as_ref(), method_name, ]) .observe(start_time.elapsed().as_secs_f64()); @@ -390,7 +386,9 @@ pub enum KeyType { IdkgDealingEncryptionLocal, } -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, strum_macros::Display)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, strum_macros::Display, AsRefStr, +)] #[strum(serialize_all = "snake_case")] #[cfg_attr(test, derive(IntoStaticStr))] pub enum MetricsDomain { @@ -448,7 +446,9 @@ pub enum KeyRotationResult { PublicKeyNotFound, } -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, strum_macros::Display)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, strum_macros::Display, AsRefStr, +)] #[strum(serialize_all = "snake_case")] #[cfg_attr(test, derive(IntoStaticStr))] pub enum ServiceType { @@ -456,7 +456,9 @@ pub enum ServiceType { Server, } -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, strum_macros::Display)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, strum_macros::Display, AsRefStr, +)] #[strum(serialize_all = "snake_case")] #[cfg_attr(test, derive(IntoStaticStr))] pub enum MessageType { diff --git a/rs/execution_environment/src/history.rs b/rs/execution_environment/src/history.rs index 42724bf03ff9..f29326fa3ea1 100644 --- a/rs/execution_environment/src/history.rs +++ b/rs/execution_environment/src/history.rs @@ -294,12 +294,12 @@ impl IngressHistoryWriter for IngressHistoryWriterImpl { self.metrics .message_state_transition_failed_ic_duration_seconds - .with_label_values(&[&reject_code, user_error_code_string]) + .with_label_values(&[reject_code.as_str(), user_error_code_string]) .observe(ic_duration); self.metrics .message_state_transition_failed_wall_clock_duration_seconds - .with_label_values(&[&reject_code, user_error_code_string]) + .with_label_values(&[reject_code.as_str(), user_error_code_string]) .observe(wall_duration); } } diff --git a/rs/execution_environment/src/metrics.rs b/rs/execution_environment/src/metrics.rs index ce04eb495eb8..880c7548f073 100644 --- a/rs/execution_environment/src/metrics.rs +++ b/rs/execution_environment/src/metrics.rs @@ -306,7 +306,7 @@ impl QueryHandlerMetrics { }; self.subnet_query_messages - .with_label_values(&[method_name_label, status_label]) + .with_label_values(&[method_name_label.as_str(), status_label]) .observe(duration); } } diff --git a/rs/http_endpoints/public/src/lib.rs b/rs/http_endpoints/public/src/lib.rs index 616b4d162647..ae446ec719ef 100644 --- a/rs/http_endpoints/public/src/lib.rs +++ b/rs/http_endpoints/public/src/lib.rs @@ -734,7 +734,7 @@ async fn collect_timer_metric( metrics .request_body_size_bytes - .with_label_values(&[&path, LABEL_UNKNOWN]) + .with_label_values(&[path.as_str(), LABEL_UNKNOWN]) .observe(request.body().size_hint().lower() as f64); let request_timer = HistogramVecTimer::start_timer( diff --git a/rs/https_outcalls/adapter/src/rpc_server.rs b/rs/https_outcalls/adapter/src/rpc_server.rs index c608271ce17f..064de62e4eb9 100644 --- a/rs/https_outcalls/adapter/src/rpc_server.rs +++ b/rs/https_outcalls/adapter/src/rpc_server.rs @@ -201,9 +201,9 @@ impl CanisterHttp { self.metrics .socks_connection_attempts .with_label_values(&[ - &tries.to_string(), + tries.to_string().as_str(), "success", - socks_proxy_addr, + socks_proxy_addr.as_str(), url_format, ]) .inc(); @@ -213,9 +213,9 @@ impl CanisterHttp { self.metrics .socks_connection_attempts .with_label_values(&[ - &tries.to_string(), + tries.to_string().as_str(), "failure", - socks_proxy_addr, + socks_proxy_addr.as_str(), url_format, ]) .inc(); @@ -352,7 +352,7 @@ impl HttpsOutcallsService for CanisterHttp { CanisterHttpError { kind: CanisterHttpErrorKind::Connection as i32, message: format!( - "Connecting to {:.50} failed: direct connect {direct_err:?} + "Connecting to {:.50} failed: direct connect {direct_err:?} and connect through socks {socks_err:?}", uri.host().unwrap_or(""), ), diff --git a/rs/https_outcalls/client/src/client.rs b/rs/https_outcalls/client/src/client.rs index 8e8375978a3f..091c4a478901 100644 --- a/rs/https_outcalls/client/src/client.rs +++ b/rs/https_outcalls/client/src/client.rs @@ -259,7 +259,7 @@ impl NonBlockingChannel for CanisterHttpAdapterClientImpl { metrics .http_request_duration - .with_label_values(&[&status.to_string(), request_http_method.as_str()]) + .with_label_values(&[status.to_string().as_str(), request_http_method.as_str()]) .observe(adapter_req_timer.elapsed().as_secs_f64()); validate_http_headers_and_body( diff --git a/rs/ic_os/vsock/vsock_lib/Cargo.toml b/rs/ic_os/vsock/vsock_lib/Cargo.toml index 4d8b083d1c0f..835b7a660400 100644 --- a/rs/ic_os/vsock/vsock_lib/Cargo.toml +++ b/rs/ic_os/vsock/vsock_lib/Cargo.toml @@ -12,7 +12,7 @@ serde = { workspace = true } serde_json = { workspace = true } [target.'cfg(target_os = "linux")'.dependencies] -procfs = { version = "^0.9" } +procfs = { workspace = true } reqwest = { workspace = true } rusb = "0.9" sha2 = { workspace = true } diff --git a/rs/ic_os/vsock/vsock_lib/src/host/agent.rs b/rs/ic_os/vsock/vsock_lib/src/host/agent.rs index 1fc185305881..cd3411661886 100644 --- a/rs/ic_os/vsock/vsock_lib/src/host/agent.rs +++ b/rs/ic_os/vsock/vsock_lib/src/host/agent.rs @@ -52,7 +52,7 @@ fn get_hostos_vsock_version() -> Response { fn is_manual_recovery_running() -> bool { match procfs::process::all_processes() { - Ok(processes) => processes.into_iter().any(|process| { + Ok(processes) => processes.into_iter().filter_map(Result::ok).any(|process| { process.cmdline().is_ok_and(|args| { let cmd = args.join(" "); cmd.contains("hostos_tool") && cmd.contains("manual-recovery") diff --git a/rs/messaging/src/message_routing.rs b/rs/messaging/src/message_routing.rs index 4256fe0709c2..908e738590d5 100644 --- a/rs/messaging/src/message_routing.rs +++ b/rs/messaging/src/message_routing.rs @@ -918,7 +918,7 @@ impl BatchProcessorImpl { let own_subnet_type: SubnetType = subnet_record.subnet_type.try_into().unwrap_or_default(); self.metrics .subnet_info - .with_label_values(&[&own_subnet_id.to_string(), own_subnet_type.as_ref()]) + .with_label_values(&[own_subnet_id.to_string().as_str(), own_subnet_type.as_ref()]) .set(1); self.metrics.subnet_size.set(subnet_size as i64); self.metrics diff --git a/rs/monitoring/adapter_metrics/client/src/lib.rs b/rs/monitoring/adapter_metrics/client/src/lib.rs index 5a4a77e75d7c..16e51477caf0 100644 --- a/rs/monitoring/adapter_metrics/client/src/lib.rs +++ b/rs/monitoring/adapter_metrics/client/src/lib.rs @@ -78,9 +78,7 @@ impl AdapterMetrics { let mut mf = MetricFamily::parse_from_bytes(b).unwrap_or_default(); // Prepend unique adapter prefix to avoid prometheus duplicate. // I.e adapter_btc_requests - mf.set_name( - ADAPTER_PREFIX.to_owned() + "_" + self.name + "_" + mf.get_name(), - ); + mf.set_name(ADAPTER_PREFIX.to_owned() + "_" + self.name + "_" + mf.name()); mf }) .collect(); diff --git a/rs/monitoring/metrics/Cargo.toml b/rs/monitoring/metrics/Cargo.toml index 5a3e04abaf71..59bd94425cb0 100644 --- a/rs/monitoring/metrics/Cargo.toml +++ b/rs/monitoring/metrics/Cargo.toml @@ -20,4 +20,4 @@ ic-logger = { path = "../logger" } slog = { workspace = true } [target.'cfg(target_os = "linux")'.dependencies] -procfs = { version = "^0.9", default-features = false } +procfs = { workspace = true } diff --git a/rs/monitoring/metrics/src/adapter_metrics_registry.rs b/rs/monitoring/metrics/src/adapter_metrics_registry.rs index da341b61ebd4..8a3428c3973b 100644 --- a/rs/monitoring/metrics/src/adapter_metrics_registry.rs +++ b/rs/monitoring/metrics/src/adapter_metrics_registry.rs @@ -78,7 +78,7 @@ impl AdapterMetricsRegistry { match adapter_metrics { Ok(m) => { scrape_duration - .with_label_values(&[&adapter_name, "success"]) + .with_label_values(&[adapter_name.as_str(), "success"]) .observe(now.elapsed().as_secs_f64()); m } diff --git a/rs/monitoring/metrics/src/histogram_vec_timer.rs b/rs/monitoring/metrics/src/histogram_vec_timer.rs index e23f528dffda..f567bc80a2ec 100644 --- a/rs/monitoring/metrics/src/histogram_vec_timer.rs +++ b/rs/monitoring/metrics/src/histogram_vec_timer.rs @@ -32,7 +32,7 @@ impl<'a, const LABEL_COUNT: usize> HistogramVecTimer<'a, LABEL_COUNT> { label_values: [&'a str; LABEL_COUNT], ) -> HistogramVecTimer<'a, LABEL_COUNT> { #[cfg(debug_assertions)] - let label_map = label_names + let label_map: std::collections::HashMap<&str, &str> = label_names .iter() .cloned() .zip(label_values.iter().cloned()) @@ -179,6 +179,6 @@ mod tests { label_values: &[&str], ) -> prometheus::proto::Histogram { let metric = hist.with_label_values(label_values).metric(); - metric.get_histogram().clone() + metric.get_histogram().get_or_default().clone() } } diff --git a/rs/monitoring/metrics/src/process_collector.rs b/rs/monitoring/metrics/src/process_collector.rs index 7ee89b78cc10..171943ba4196 100644 --- a/rs/monitoring/metrics/src/process_collector.rs +++ b/rs/monitoring/metrics/src/process_collector.rs @@ -53,7 +53,11 @@ impl Collector for ProcessCollector { } }; - self.threads.set(p.stat.num_threads as f64); + self.threads.set( + p.stat() + .map(|stat| stat.num_threads as f64) + .unwrap_or_default(), + ); let mut mfs = Vec::with_capacity(METRIC_COUNT); mfs.extend(self.threads.collect()); diff --git a/rs/orchestrator/src/metrics.rs b/rs/orchestrator/src/metrics.rs index 76acb2ce5ae7..488fe89a40a7 100644 --- a/rs/orchestrator/src/metrics.rs +++ b/rs/orchestrator/src/metrics.rs @@ -1,6 +1,6 @@ use prometheus::{IntCounter, IntCounterVec, IntGauge, IntGaugeVec}; -use strum::IntoEnumIterator; -use strum_macros::{EnumIter, IntoStaticStr}; +use strum::{AsRefStr, IntoEnumIterator}; +use strum_macros::EnumIter; pub(crate) const PROMETHEUS_HTTP_PORT: u16 = 9091; @@ -20,7 +20,7 @@ pub(crate) struct OrchestratorMetrics { pub(crate) critical_error_task_failed: IntCounterVec, } -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, IntoStaticStr)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, EnumIter, AsRefStr)] pub(crate) enum KeyRotationStatus { Disabled, TooRecent, @@ -110,7 +110,7 @@ impl OrchestratorMetrics { .filter(|s| !status.is_transient() || !s.is_error()) .for_each(|s| { self.key_rotation_status - .with_label_values(&[s.into()]) + .with_label_values(&[s.as_ref()]) .set((s == status) as i64); }); } @@ -118,7 +118,7 @@ impl OrchestratorMetrics { /// Set the error status to '1'. pub fn observe_key_rotation_error(&self) { self.key_rotation_status - .with_label_values(&[KeyRotationStatus::Error.into()]) + .with_label_values(&[KeyRotationStatus::Error.as_ref()]) .set(1); } } diff --git a/rs/orchestrator/src/orchestrator.rs b/rs/orchestrator/src/orchestrator.rs index 9b39956830c2..df469ce06975 100644 --- a/rs/orchestrator/src/orchestrator.rs +++ b/rs/orchestrator/src/orchestrator.rs @@ -752,7 +752,7 @@ impl TaskTracker { error!(self.logger, "Task `{task_name}` panicked: {err}"); self.metrics .critical_error_task_failed - .with_label_values(&[&task_name, "panic"]) + .with_label_values(&[task_name.as_str(), "panic"]) .inc(); } else { info!(self.logger, "Task `{task_name}` was cancelled"); diff --git a/rs/state_manager/src/state_sync/chunkable.rs b/rs/state_manager/src/state_sync/chunkable.rs index 48d08dc59118..85b19487aaf8 100644 --- a/rs/state_manager/src/state_sync/chunkable.rs +++ b/rs/state_manager/src/state_sync/chunkable.rs @@ -1780,8 +1780,8 @@ impl Chunkable for IncompleteState { .state_sync_metrics .add_chunk_duration .with_label_values(&[ - &state_before, - &state_after, + state_before.as_str(), + state_after.as_str(), if success { "ok" } else { "err" }, ]) .observe(started_at.elapsed().as_secs_f64()); diff --git a/rs/state_manager/tests/state_manager.rs b/rs/state_manager/tests/state_manager.rs index 073d47beba61..68e0f0165945 100644 --- a/rs/state_manager/tests/state_manager.rs +++ b/rs/state_manager/tests/state_manager.rs @@ -288,8 +288,8 @@ fn lsmt_merge_overhead() { .prometheus_registry() .gather() .into_iter() - .filter(|x| x.get_name() == "canister_memory_usage_bytes") - .map(|x| x.get_metric()[0].get_gauge().get_value()) + .filter(|x| x.name() == "canister_memory_usage_bytes") + .map(|x| x.get_metric()[0].get_gauge().get_or_default().value()) .next() .unwrap() } @@ -335,13 +335,13 @@ fn lazy_pagemaps() { .prometheus_registry() .gather() .into_iter() - .filter(|x| x.get_name() == "state_manager_num_page_maps_by_load_status") + .filter(|x| x.name() == "state_manager_num_page_maps_by_load_status") .map(|x| -> f64 { x.get_metric() .iter() .find(|x| { for l in x.get_label() { - if l.get_name() == "status" && l.get_value() == status { + if l.name() == "status" && l.value() == status { return true; } } @@ -349,7 +349,8 @@ fn lazy_pagemaps() { }) .unwrap() .get_gauge() - .get_value() + .get_or_default() + .value() }) .next() .unwrap() as i64 @@ -378,13 +379,13 @@ fn lazy_wasms() { .prometheus_registry() .gather() .into_iter() - .filter(|x| x.get_name() == "state_manager_num_loaded_wasm_files_by_source") + .filter(|x| x.name() == "state_manager_num_loaded_wasm_files_by_source") .map(|x| -> f64 { x.get_metric() .iter() .find(|x| { for l in x.get_label() { - if l.get_name() == "source" && l.get_value() == source { + if l.name() == "source" && l.value() == source { return true; } } @@ -392,7 +393,8 @@ fn lazy_wasms() { }) .unwrap() .get_gauge() - .get_value() + .get_or_default() + .value() }) .next() .unwrap() as i64 diff --git a/rs/test_utilities/metrics/src/lib.rs b/rs/test_utilities/metrics/src/lib.rs index ae98a3abae47..68f958d6d2a3 100644 --- a/rs/test_utilities/metrics/src/lib.rs +++ b/rs/test_utilities/metrics/src/lib.rs @@ -46,7 +46,7 @@ pub fn fetch_histogram_vec_stats( let mut stats = MetricVec::new(); for metric_family in registry.prometheus_registry().gather() { - if metric_family.get_name() == name { + if metric_family.name() == name { assert_eq!(MetricType::HISTOGRAM, metric_family.get_field_type()); for metric in metric_family.get_metric() { stats.insert( @@ -169,10 +169,13 @@ pub fn fetch_counter_vec(registry: &MetricsRegistry, name: &str) -> MetricVec MetricVec let mut values = MetricVec::new(); for metric_family in registry.prometheus_registry().gather() { - if metric_family.get_name() == name { + if metric_family.name() == name { assert_eq!(MetricType::GAUGE, metric_family.get_field_type()); for metric in metric_family.get_metric() { - values.insert(to_labels(metric), metric.get_gauge().get_value()); + values.insert( + to_labels(metric), + metric.get_gauge().get_or_default().value(), + ); } break; } @@ -306,8 +312,8 @@ fn to_labels(metric: &prometheus::proto::Metric) -> Labels { .iter() .map(|label_pair| { ( - label_pair.get_name().to_string(), - label_pair.get_value().to_string(), + label_pair.name().to_string(), + label_pair.value().to_string(), ) }) .collect()