From 09052813ef288cf77810cec274c3bfb652e2965b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Mon, 6 Nov 2023 11:55:06 +0100 Subject: [PATCH] feat(receiver-mock): update otel proto to 1.0.0 --- src/rust/receiver-mock/Cargo.lock | 379 +++++----------------- src/rust/receiver-mock/Cargo.toml | 4 +- src/rust/receiver-mock/src/router/otlp.rs | 39 +-- 3 files changed, 103 insertions(+), 319 deletions(-) diff --git a/src/rust/receiver-mock/Cargo.lock b/src/rust/receiver-mock/Cargo.lock index 563a62b7..a47fa4e1 100644 --- a/src/rust/receiver-mock/Cargo.lock +++ b/src/rust/receiver-mock/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ "actix-service 2.0.2", "actix-utils", "ahash", - "base64 0.21.5", + "base64", "bitflags 2.4.0", "brotli", "bytes", @@ -106,7 +106,7 @@ dependencies = [ "futures-util", "mio", "num_cpus", - "socket2 0.4.4", + "socket2 0.4.10", "tokio", "tracing", ] @@ -305,36 +305,15 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" -[[package]] -name = "async-stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" -dependencies = [ - "async-stream-impl", - "futures-core", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.104", -] - [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.28", ] [[package]] @@ -356,9 +335,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.5.13" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9496f0c1d1afb7a2af4338bbe1d969cddfead41d87a9fb3aaa6d0bbc7af648" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", "axum-core", @@ -374,20 +353,19 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", + "rustversion", "serde", "sync_wrapper", - "tokio", "tower", - "tower-http", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.2.8" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c0a60006f2a293d82d571f635042a72edf927539b7685bd62d361963839b" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", "bytes", @@ -395,16 +373,11 @@ dependencies = [ "http", "http-body", "mime", + "rustversion", "tower-layer", "tower-service", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.5" @@ -647,17 +620,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "dashmap" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0834a35a3fce649144119e18da2a4d8ed12ef3862f47183fd46f625d072d96c" -dependencies = [ - "cfg-if", - "num_cpus", - "parking_lot", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -706,27 +668,12 @@ dependencies = [ "regex", ] -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - [[package]] name = "firestorm" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "flate2" version = "1.0.24" @@ -753,20 +700,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "futures" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.21" @@ -774,7 +707,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", - "futures-sink", ] [[package]] @@ -794,12 +726,6 @@ dependencies = [ "futures-util", ] -[[package]] -name = "futures-io" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" - [[package]] name = "futures-macro" version = "0.3.21" @@ -829,13 +755,10 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ - "futures-channel", "futures-core", - "futures-io", "futures-macro", "futures-sink", "futures-task", - "memchr", "pin-project-lite", "pin-utils", "slab", @@ -930,17 +853,11 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -950,9 +867,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -965,7 +882,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.4", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1019,15 +936,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "itertools" version = "0.10.5" @@ -1048,9 +956,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -1063,9 +971,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -1090,9 +998,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "local-channel" @@ -1136,9 +1044,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "matchit" -version = "0.5.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" @@ -1173,12 +1081,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - [[package]] name = "num-traits" version = "0.2.15" @@ -1214,36 +1116,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" [[package]] -name = "opentelemetry" -version = "0.18.0" +name = "opentelemetry-proto" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d6c3d7288a106c0a363e4b0e8d308058d56902adefb16f4936f417ffef086e" +checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" dependencies = [ "opentelemetry_api", "opentelemetry_sdk", -] - -[[package]] -name = "opentelemetry-proto" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61a2f56df5574508dd86aaca016c917489e589ece4141df1b5e349af8d66c28" -dependencies = [ - "futures", - "futures-util", - "opentelemetry", "prost", "tonic", - "tonic-build", ] [[package]] name = "opentelemetry_api" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c24f96e21e7acc813c7a8394ee94978929db2bcc46cf6b5014fc612bf7760c22" +checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" dependencies = [ - "fnv", "futures-channel", "futures-util", "indexmap", @@ -1251,28 +1140,39 @@ dependencies = [ "once_cell", "pin-project-lite", "thiserror", + "urlencoding", ] [[package]] name = "opentelemetry_sdk" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca41c4933371b61c2a2f214bf16931499af4ec90543604ec828f7a625c09113" +checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" dependencies = [ "async-trait", "crossbeam-channel", - "dashmap", - "fnv", "futures-channel", "futures-executor", "futures-util", "once_cell", "opentelemetry_api", + "ordered-float", "percent-encoding", "rand", + "regex", + "serde_json", "thiserror", ] +[[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 = "parking_lot" version = "0.12.1" @@ -1308,16 +1208,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "petgraph" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" -dependencies = [ - "fixedbitset", - "indexmap", -] - [[package]] name = "pin-project" version = "0.4.29" @@ -1376,16 +1266,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" -[[package]] -name = "prettyplease" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697ae720ee02011f439e0701db107ffe2916d83f718342d65d7f8bf7b8a5fee9" -dependencies = [ - "proc-macro2", - "syn 1.0.104", -] - [[package]] name = "proc-macro2" version = "1.0.63" @@ -1397,11 +1277,12 @@ dependencies = [ [[package]] name = "prometheus-parse" -version = "0.2.1" -source = "git+https://github.com/ccakes/prometheus-parse-rs?rev=a4574e9bade29b8af31e68b68a5392c61cbb74cd#a4574e9bade29b8af31e68b68a5392c61cbb74cd" +version = "0.2.4" +source = "git+https://github.com/ccakes/prometheus-parse-rs#873a83cb4029e001c9a7c813ccad4fa986da3919" dependencies = [ "chrono", - "lazy_static", + "itertools 0.10.5", + "once_cell", "regex", ] @@ -1415,26 +1296,6 @@ dependencies = [ "prost-derive", ] -[[package]] -name = "prost-build" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" -dependencies = [ - "bytes", - "heck", - "itertools 0.10.5", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "regex", - "tempfile", - "which", -] - [[package]] name = "prost-derive" version = "0.11.0" @@ -1448,16 +1309,6 @@ dependencies = [ "syn 1.0.104", ] -[[package]] -name = "prost-types" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" -dependencies = [ - "bytes", - "prost", -] - [[package]] name = "quote" version = "1.0.29" @@ -1506,7 +1357,7 @@ dependencies = [ "actix-service 1.0.6", "actix-web", "anyhow", - "base64 0.21.5", + "base64", "bytes", "chrono", "clap", @@ -1552,15 +1403,6 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "rustc_version" version = "0.4.0" @@ -1570,6 +1412,12 @@ dependencies = [ "semver", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.10" @@ -1677,9 +1525,9 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -1729,20 +1577,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - [[package]] name = "thiserror" version = "1.0.32" @@ -1830,7 +1664,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.4.4", + "socket2 0.4.10", "tokio-macros", "windows-sys 0.42.0", ] @@ -1883,14 +1717,13 @@ dependencies = [ [[package]] name = "tonic" -version = "0.8.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd56bdb54ef93935a6a79dbd1d91f1ebd4c64150fd61654031fd6b8b775c91" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ - "async-stream", "async-trait", "axum", - "base64 0.13.1", + "base64", "bytes", "futures-core", "futures-util", @@ -1902,28 +1735,12 @@ dependencies = [ "percent-encoding", "pin-project 1.0.11", "prost", - "prost-derive", "tokio", "tokio-stream", - "tokio-util", "tower", "tower-layer", "tower-service", "tracing", - "tracing-futures", -] - -[[package]] -name = "tonic-build" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fbcd2800e34e743b9ae795867d5f77b535d3a3be69fd731e39145719752df8c" -dependencies = [ - "prettyplease", - "proc-macro2", - "prost-build", - "quote", - "syn 1.0.104", ] [[package]] @@ -1946,30 +1763,11 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" -dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" @@ -2010,16 +1808,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project 1.0.11", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.3" @@ -2065,6 +1853,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf8parse" version = "0.2.1" @@ -2095,9 +1889,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2105,24 +1899,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.28", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2130,33 +1924,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 1.0.104", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" - -[[package]] -name = "which" -version = "4.2.5" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" -dependencies = [ - "either", - "lazy_static", - "libc", -] +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "winapi" diff --git a/src/rust/receiver-mock/Cargo.toml b/src/rust/receiver-mock/Cargo.toml index f08bad4f..ecd8af4c 100644 --- a/src/rust/receiver-mock/Cargo.toml +++ b/src/rust/receiver-mock/Cargo.toml @@ -21,9 +21,9 @@ timer = "0.2" chrono = { version = "0.4", features = ["serde"] } json_str = "*" rand = "0.8" -prometheus-parse = { git = "https://github.com/ccakes/prometheus-parse-rs", rev = "a4574e9bade29b8af31e68b68a5392c61cbb74cd" } +prometheus-parse = { git = "https://github.com/ccakes/prometheus-parse-rs", version = "0.2.4" } http = "0.2" -opentelemetry-proto = { version = "0.1.0", features = ["gen-tonic", "build-server", "logs", "metrics", "traces"] } +opentelemetry-proto = { version = "0.3.0", features = ["gen-tonic", "logs", "metrics", "traces"] } prost = "0.11.0" itertools = "0.11.0" log = "0.4.20" diff --git a/src/rust/receiver-mock/src/router/otlp.rs b/src/rust/receiver-mock/src/router/otlp.rs index 4672fb8a..ee867eb5 100644 --- a/src/rust/receiver-mock/src/router/otlp.rs +++ b/src/rust/receiver-mock/src/router/otlp.rs @@ -84,7 +84,7 @@ fn get_otlp_metadata_from_logs(resource_logs: &logsv1::ResourceLogs) -> Metadata fn get_otlp_lines_from_logs(resource_logs: &logsv1::ResourceLogs) -> Vec { resource_logs - .instrumentation_library_logs + .scope_logs .iter() .map(|ill| ill.log_records.iter()) .flatten() @@ -144,7 +144,7 @@ pub async fn handler_receiver_otlp_metrics( } let resource_attributes = &resource_metrics.resource.unwrap().attributes; - for instrumentation_lib_metrics in resource_metrics.instrumentation_library_metrics { + for instrumentation_lib_metrics in resource_metrics.scope_metrics { for metric in instrumentation_lib_metrics.metrics { let metric_sample_vec = sample::otlp_metric_to_samples(&metric, resource_attributes); @@ -208,7 +208,7 @@ pub async fn handler_receiver_otlp_traces( } let resource_attrs = resource_spans.resource.unwrap().attributes; - for instrumentation_lib_spans in resource_spans.instrumentation_library_spans { + for instrumentation_lib_spans in resource_spans.scope_spans { for span in instrumentation_lib_spans.spans { let storage_span = otlp_span_to_span(&span, &resource_attrs); if opts.print.spans { @@ -485,11 +485,11 @@ mod test { use actix_web::test as actix_test; use actix_web::{web, App}; use bytes::Bytes; - use opentelemetry_proto::tonic::metrics::v1::{InstrumentationLibraryMetrics, Metric, ResourceMetrics}; - use opentelemetry_proto::tonic::trace::v1::{InstrumentationLibrarySpans, ResourceSpans}; + use opentelemetry_proto::tonic::metrics::v1::{Metric, ResourceMetrics, ScopeMetrics}; + use opentelemetry_proto::tonic::trace::v1::{ResourceSpans, ScopeSpans}; use opentelemetry_proto::tonic::{ - common::v1::{any_value::Value, AnyValue, InstrumentationLibrary, KeyValue}, - logs::v1::{InstrumentationLibraryLogs, LogRecord}, + common::v1::{any_value::Value, AnyValue, InstrumentationScope, KeyValue}, + logs::v1::{LogRecord, ScopeLogs}, resource::v1::Resource, }; @@ -531,7 +531,6 @@ mod test { body: Some(AnyValue { value: Some(Value::StringValue(body.to_string())), }), - name: "temperature log".to_string(), attributes: vec![], dropped_attributes_count: 0, flags: 0b101010, @@ -560,18 +559,20 @@ mod test { } } - fn get_sample_instr_library() -> InstrumentationLibrary { - InstrumentationLibrary { + fn get_sample_instr_library() -> InstrumentationScope { + InstrumentationScope { name: "the best library".to_string(), version: "v2.1.5".to_string(), + attributes: vec![], + dropped_attributes_count: 0, } } fn get_sample_logs_data() -> logsv1::LogsData { let resource = get_sample_resource(); - let instr = vec![InstrumentationLibraryLogs { - instrumentation_library: Some(get_sample_instr_library()), + let instr = vec![ScopeLogs { + scope: Some(get_sample_instr_library()), log_records: vec![ get_sample_log_record("warning: the temperature is too low"), get_sample_log_record("killing child with a fork"), @@ -581,7 +582,7 @@ mod test { let resource_logs_1 = logsv1::ResourceLogs { resource: Some(resource.clone()), - instrumentation_library_logs: instr, + scope_logs: instr, schema_url: String::new(), }; @@ -790,14 +791,14 @@ mod test { fn get_sample_metrics_data() -> metricsv1::MetricsData { let resource = get_sample_resource(); - let instr = vec![InstrumentationLibraryMetrics { - instrumentation_library: Some(get_sample_instr_library()), + let instr = vec![ScopeMetrics { + scope: Some(get_sample_instr_library()), metrics: vec![get_sample_metric("length"), get_sample_metric("breath")], schema_url: "".to_string(), }]; let resource_metrics_1 = ResourceMetrics { resource: Some(resource), - instrumentation_library_metrics: instr, + scope_metrics: instr, schema_url: "".to_string(), }; let resource_metrics_2 = resource_metrics_1.clone(); @@ -917,8 +918,8 @@ mod test { fn get_sample_spans_data() -> tracev1::TracesData { let resource = get_sample_resource(); - let instr = vec![InstrumentationLibrarySpans { - instrumentation_library: Some(get_sample_instr_library()), + let instr = vec![ScopeSpans { + scope: Some(get_sample_instr_library()), spans: vec![ get_sample_span("parent", "aaaa", "", "bbbb"), get_sample_span("child", "cccc", "aaaa", "bbbb"), @@ -927,7 +928,7 @@ mod test { }]; let resource_spans_1 = ResourceSpans { resource: Some(resource), - instrumentation_library_spans: instr, + scope_spans: instr, schema_url: "".to_string(), }; tracev1::TracesData {