diff --git a/.clippy.toml b/.clippy.toml new file mode 100644 index 0000000..d5acd3f --- /dev/null +++ b/.clippy.toml @@ -0,0 +1,19 @@ +allowed-duplicate-crates = [ + "base64", + "bitflags", + "hashbrown", + "indexmap", + "regex-automata", + "regex-syntax", + "socket2", + "tracing-log", + "windows-sys", + "windows-targets", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc" +] diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 2fef290..4383d25 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -22,5 +22,7 @@ jobs: git config --global user.name "${{ github.triggering_actor }}" git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com" - name: Prepare Prerelease - run: knope release --prerelease-label=rc --verbose + run: | + git pull origin --tags + knope release --prerelease-label=dev --verbose diff --git a/Cargo.lock b/Cargo.lock index 885a7e9..6a66477 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,18 +19,18 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-stream" @@ -51,40 +51,45 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" -version = "0.6.20" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", "http", "http-body", - "hyper", + "http-body-util", "itoa", "matchit", "memchr", @@ -101,26 +106,29 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", "futures-util", "http", "http-body", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper", "tower-layer", "tower-service", ] [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", @@ -133,21 +141,15 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" - -[[package]] -name = "bitflags" -version = "1.3.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -160,24 +162,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -203,32 +202,13 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -251,9 +231,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "equivalent" @@ -261,22 +241,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - [[package]] name = "fnv" version = "1.0.7" @@ -285,9 +249,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -300,9 +264,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -310,15 +274,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -327,44 +291,44 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -390,9 +354,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -401,23 +365,29 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.22" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", - "indexmap 2.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -446,9 +416,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -458,15 +428,21 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.11" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -475,12 +451,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", + "futures-util", "http", + "http-body", "pin-project-lite", ] @@ -498,13 +486,12 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", @@ -513,23 +500,41 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ "hyper", + "hyper-util", "pin-project-lite", "tokio", - "tokio-io-timeout", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -544,40 +549,40 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] name = "indoc" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -590,21 +595,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" - -[[package]] -name = "linux-raw-sys" -version = "0.4.11" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -612,9 +611,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "matchers" @@ -633,15 +632,15 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -654,18 +653,18 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -682,15 +681,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.16.0" @@ -703,18 +693,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl-probe" @@ -724,26 +714,29 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "opentelemetry" -version = "0.20.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" +checksum = "803801d3d3b71cd026851a53f974ea03df3d179cb758b260136a6c9e22e196af" dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk", + "futures-core", + "futures-sink", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", ] [[package]] name = "opentelemetry-otlp" -version = "0.13.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" +checksum = "596b1719b3cab83addb20bcbffdf21575279d9436d9ccccfe651a3bf0ab5ab06" dependencies = [ "async-trait", "futures-core", "http", + "opentelemetry", "opentelemetry-proto", - "opentelemetry-semantic-conventions", - "opentelemetry_api", "opentelemetry_sdk", "prost", "thiserror", @@ -753,87 +746,39 @@ dependencies = [ [[package]] name = "opentelemetry-proto" -version = "0.3.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" -dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk", - "prost", - "tonic", -] - -[[package]] -name = "opentelemetry-semantic-conventions" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" +checksum = "2c43620e8f93359eb7e627a3b16ee92d8585774986f24f2ab010817426c5ce61" dependencies = [ + "hex", "opentelemetry", -] - -[[package]] -name = "opentelemetry-stdout" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd550321bc0f9d3f6dcbfe5c75262789de5b3e2776da2cbcfd2392aa05db0c6" -dependencies = [ - "futures-util", - "opentelemetry_api", "opentelemetry_sdk", - "ordered-float", + "prost", "serde", - "serde_json", -] - -[[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", - "urlencoding", + "tonic", ] [[package]] name = "opentelemetry_sdk" -version = "0.20.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" +checksum = "e0da0d6b47a3dbc6e9c9e36a0520e25cf943e046843818faaa3f87365a548c82" dependencies = [ "async-trait", - "crossbeam-channel", "futures-channel", "futures-executor", "futures-util", + "glob", "once_cell", - "opentelemetry_api", - "ordered-float", + "opentelemetry", "percent-encoding", "rand", - "regex", "serde_json", "thiserror", "tokio", "tokio-stream", ] -[[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 = "overload" version = "0.1.1" @@ -842,9 +787,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -852,28 +797,28 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -882,9 +827,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" dependencies = [ "pest", "pest_generator", @@ -892,22 +837,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ "once_cell", "pest", @@ -916,29 +861,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -946,6 +891,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -954,18 +905,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.9" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -973,28 +924,29 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "pyo3" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" +checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "parking_lot", + "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -1016,9 +968,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" +checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" dependencies = [ "once_cell", "target-lexicon", @@ -1026,9 +978,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" +checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" dependencies = [ "libc", "pyo3-build-config", @@ -1036,36 +988,36 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" +checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "pyo3-macros-backend" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" +checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" dependencies = [ "heck", "proc-macro2", + "pyo3-build-config", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "pyo3-opentelemetry" -version = "0.3.1" +version = "0.3.2-dev.1" dependencies = [ "futures-util", "once_cell", "opentelemetry", - "opentelemetry_api", "opentelemetry_sdk", "pyo3", "pyo3-opentelemetry-macros", @@ -1080,7 +1032,6 @@ name = "pyo3-opentelemetry-lib" version = "0.1.0" dependencies = [ "opentelemetry", - "opentelemetry_api", "opentelemetry_sdk", "pyo3", "pyo3-asyncio", @@ -1094,31 +1045,29 @@ dependencies = [ [[package]] name = "pyo3-opentelemetry-macros" -version = "0.3.1" +version = "0.3.2-dev.1" dependencies = [ "proc-macro2", "quote", "rstest", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "pyo3-tracing-subscriber" -version = "0.1.1" +version = "0.1.2-dev.1" dependencies = [ + "futures-core", "handlebars", "opentelemetry", "opentelemetry-otlp", "opentelemetry-proto", - "opentelemetry-stdout", - "opentelemetry_api", "opentelemetry_sdk", "pyo3", "pyo3-asyncio", "rstest", "serde", "serde_json", - "tempfile", "thiserror", "tokio", "tonic", @@ -1129,9 +1078,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1168,32 +1117,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -1207,13 +1147,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -1224,9 +1164,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "ring" @@ -1271,9 +1211,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" @@ -1284,73 +1224,72 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.48.0", -] - [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ "log", + "once_cell", "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ "base64", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" @@ -1367,23 +1306,13 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -1402,37 +1331,38 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1450,9 +1380,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -1468,28 +1398,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" - -[[package]] -name = "socket2" -version = "0.4.10" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1498,6 +1418,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.109" @@ -1511,9 +1437,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -1522,54 +1448,41 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" - -[[package]] -name = "tempfile" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall 0.4.1", - "rustix", - "windows-sys 0.48.0", -] +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -1577,9 +1490,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.32.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -1588,47 +1501,38 @@ dependencies = [ "num_cpus", "parking_lot", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -1637,41 +1541,41 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "tonic" -version = "0.9.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", "axum", "base64", "bytes", - "futures-core", - "futures-util", "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", "prost", "rustls-native-certs", "rustls-pemfile", + "socket2", "tokio", "tokio-rustls", "tokio-stream", @@ -1715,11 +1619,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1727,20 +1631,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -1748,21 +1652,22 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-opentelemetry" -version = "0.21.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" +checksum = "5eabc56d23707ad55ba2a0750fc24767125d5a0f51993ba41ad2c441cc7b8dea" dependencies = [ + "js-sys", "once_cell", "opentelemetry", "opentelemetry_sdk", @@ -1771,6 +1676,7 @@ dependencies = [ "tracing-core", "tracing-log", "tracing-subscriber", + "web-time", ] [[package]] @@ -1785,9 +1691,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -1806,9 +1712,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -1840,12 +1746,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "valuable" version = "0.1.0" @@ -1875,9 +1775,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1885,24 +1785,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1910,22 +1810,32 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "winapi" @@ -1964,7 +1874,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -1984,17 +1894,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -2005,9 +1916,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -2017,9 +1928,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -2029,9 +1940,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -2041,9 +1958,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -2053,9 +1970,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -2065,9 +1982,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -2077,6 +1994,12 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index 035dd22..9d9b58d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,17 +4,21 @@ members = ["crates/*", "examples/*"] resolver = "2" [workspace.dependencies] -thiserror = "1.0.49" -serde = { version = "1.0.188", features = ["derive"] } -opentelemetry = { version = "0.20.0" } -opentelemetry_api = { version = "0.20.0" } -opentelemetry_sdk = { version = "0.20.0" } -pyo3 = { version = "0.20.0", features = ["macros", "extension-module"] } -pyo3-asyncio = "0.20.0" +thiserror = "1.0.57" +serde = { version = "1.0.145", features = ["derive"] } +# All OTEL packages must have the same version number. +# When updating the OTEL version, be sure to update these optional dependencies in `tracing-subscriber` as well: +# * opentelemetry-otlp +# * opentelemetry-proto +opentelemetry = "0.25.0" +opentelemetry_sdk = "0.25.0" +pyo3 = { version = "0.20.0", features = ["macros"] } +pyo3-asyncio = { version = "0.20.0", features = ["tokio-runtime"] } pyo3-build-config = "0.20.0" rstest = "0.17.0" -tokio = { version = "1.27.0", features = [] } -tracing = "0.1.37" -tracing-opentelemetry = "0.21.0" +tokio = { version = "1.36.0", features = [] } +tracing = { version = "0.1.37", features = ["log"] } +# Despite how close the version numbers are, this package's release numbers *do +# not* match the OTEL SDK version that it requires. +tracing-opentelemetry = "0.26.0" tracing-subscriber = "0.3.17" - diff --git a/Makefile.toml b/Makefile.toml index 8534ec2..cb55650 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -203,8 +203,8 @@ # Reintroduce cargo deny upon resolution of https://github.com/rigetti/pyo3-opentelemetry/issues/16 [tasks.check-all] - dependencies = ["check", "clippy", "deadlinks", "msrv-verify", "nextest"] + dependencies = ["check", "clippy", "deadlinks", "msrv-verify", "deny", "nextest"] [tasks.pre-ci-flow] - dependencies = ["check", "clippy", "deadlinks", "msrv-verify"] + dependencies = ["check", "clippy", "deadlinks", "msrv-verify", "deny"] diff --git a/crates/opentelemetry-macros/CHANGELOG.md b/crates/opentelemetry-macros/CHANGELOG.md index 0f6563a..3718682 100644 --- a/crates/opentelemetry-macros/CHANGELOG.md +++ b/crates/opentelemetry-macros/CHANGELOG.md @@ -4,18 +4,6 @@ #### ci release flow (#11) -## 0.3.1-rc.1 (2023-12-18) - -### Fixes - -#### ci release flow - -## 0.3.1-rc.0 (2023-12-18) - -### Fixes - -#### ci release flow - ## 0.3.0 (2023-12-16) ### Breaking Changes diff --git a/crates/opentelemetry-macros/Cargo.toml b/crates/opentelemetry-macros/Cargo.toml index ec58f18..0ebd790 100644 --- a/crates/opentelemetry-macros/Cargo.toml +++ b/crates/opentelemetry-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-opentelemetry-macros" -version = "0.3.1" +version = "0.3.2-dev.1" edition = "2021" categories = ["Python bindings", "OpenTelemetry", "Tracing", "Macros"] keywords = ["python", "pyo3", "opentelemetry", "tracing"] diff --git a/crates/opentelemetry-macros/src/lib.rs b/crates/opentelemetry-macros/src/lib.rs index 9fedd71..2cf1f5f 100644 --- a/crates/opentelemetry-macros/src/lib.rs +++ b/crates/opentelemetry-macros/src/lib.rs @@ -16,7 +16,6 @@ #![deny(clippy::all)] #![deny(clippy::pedantic)] #![deny(clippy::cargo)] -#![allow(clippy::multiple_crate_versions)] #![warn(clippy::nursery)] // Has false positives that conflict with unreachable_pub #![allow(clippy::redundant_pub_crate)] @@ -38,7 +37,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - pointer_structural_match, private_interfaces, private_bounds, semicolon_in_expressions_from_macros, @@ -213,7 +211,7 @@ fn wrap_block_in_current_context( let error_handler: proc_macro2::TokenStream = match config.on_context_extraction_failure { RuntimeErrorHandler::Trace => syn::parse_quote! { if let Err(e) = #context_guard_name { - use opentelemetry_api::trace::TraceContextExt; + use opentelemetry::trace::TraceContextExt; let ctx = opentelemetry::Context::current(); ctx.span().record_error(&e); } @@ -338,7 +336,7 @@ fn get_item_impl_method_names(item_impl: &syn::ItemImpl) -> HashSet { /// - must be a valid Rust identifier. /// - `on_context_extraction_failure`: What to do when the context cannot be extracted from Python. Defaults to `print`. /// - `print`: Print the error to stderr and continue. -/// - `trace`: Record the error on the current span using `opentelemetry_api::trace::TraceContextExt::record_error`. +/// - `trace`: Record the error on the current span using `opentelemetry::trace::TraceContextExt::record_error`. /// - `py_error`: Return a `pyo3::PyErr`. /// - `ignore`: Ignore the error. /// - `exclude`: A list of method names to exclude. Only valid on `impl` items. @@ -356,7 +354,7 @@ fn get_item_impl_method_names(item_impl: &syn::ItemImpl) -> HashSet { /// Ok(()) /// } /// -/// #[pypropagate(context_guard_name = "_my_context_guard", on_context_extraction_failure = "py_error"))] +/// #[pypropagate(context_guard_name = "_my_context_guard", on_context_extraction_failure = "py_error")] /// #[pyfunction] /// fn my_function2(py: Python<'_>, arg1: u32, arg2: String) -> PyResult<()> { /// // ... diff --git a/crates/opentelemetry/CHANGELOG.md b/crates/opentelemetry/CHANGELOG.md index 6e757f1..0fe306d 100644 --- a/crates/opentelemetry/CHANGELOG.md +++ b/crates/opentelemetry/CHANGELOG.md @@ -6,24 +6,6 @@ #### ci release flow (#11) -## 0.3.1-rc.1 (2023-12-18) - -### Fixes - -#### update opentelemetry-macros - -#### ci release flow - -#### force rc - -## 0.3.1-rc.0 (2023-12-18) - -### Fixes - -#### update opentelemetry-macros - -#### ci release flow - ## 0.3.0 (2023-12-16) ### Breaking Changes diff --git a/crates/opentelemetry/Cargo.toml b/crates/opentelemetry/Cargo.toml index 3396736..963ce5b 100644 --- a/crates/opentelemetry/Cargo.toml +++ b/crates/opentelemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-opentelemetry" -version = "0.3.1" +version = "0.3.2-dev.1" edition = "2021" categories = ["Python bindings", "OpenTelemetry", "Tracing", "Macros"] keywords = ["python", "pyo3", "opentelemetry", "tracing"] @@ -12,19 +12,20 @@ rust-version = "1.65.0" [dependencies] opentelemetry = { workspace = true } -opentelemetry_api = { workspace = true } opentelemetry_sdk = { workspace = true } pyo3 = { workspace = true } -pyo3-opentelemetry-macros = { path = "../opentelemetry-macros", version = "0.3.1" } +pyo3-opentelemetry-macros = { path = "../opentelemetry-macros", version = "0.3.2-dev.1" } [dev-dependencies] futures-util = "0.3.28" once_cell = "1.17.1" -opentelemetry = { workspace = true, features = ["trace", "rt-tokio"] } +opentelemetry = { workspace = true, features = ["trace"] } tokio = { workspace = true, features = ["sync", "parking_lot", "macros"] } tracing = { workspace = true } tracing-opentelemetry = { workspace = true } tracing-subscriber = { workspace = true } [features] +extension-module = ["pyo3/extension-module"] +default = ["extension-module"] diff --git a/crates/opentelemetry/src/lib.rs b/crates/opentelemetry/src/lib.rs index 2d84d5e..378f93f 100644 --- a/crates/opentelemetry/src/lib.rs +++ b/crates/opentelemetry/src/lib.rs @@ -16,7 +16,6 @@ #![deny(clippy::all)] #![deny(clippy::pedantic)] #![deny(clippy::cargo)] -#![allow(clippy::multiple_crate_versions)] #![warn(clippy::nursery)] // Has false positives that conflict with unreachable_pub #![allow(clippy::redundant_pub_crate)] @@ -38,7 +37,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - pointer_structural_match, private_interfaces, private_bounds, semicolon_in_expressions_from_macros, @@ -70,7 +68,7 @@ //! //! * `pyo3-opentelemetry-macros` - a crate defining the `pypropagate` macro. //! * `pyo3-tracing-subscriber` - a crate supporting configuration and initialization of Rust -//! tracing subscribers from Python. +//! tracing subscribers from Python. //! //! # Examples //! @@ -100,7 +98,6 @@ use std::collections::HashMap; use pyo3::{prelude::*, types::IntoPyDict}; use opentelemetry::{propagation::Extractor, Context}; -use opentelemetry_api::ContextGuard; pub use pyo3_opentelemetry_macros::pypropagate; @@ -145,7 +142,7 @@ impl Carrier { /// When a `Propagator` is passed to a function or method, this method should be called /// at the beginning of the function or method to attach the context. This should not be used with /// async functions. - fn attach(&self) -> ContextGuard { + fn attach(&self) -> opentelemetry::ContextGuard { use opentelemetry::propagation::TextMapPropagator; let propagator = opentelemetry_sdk::propagation::TraceContextPropagator::new(); @@ -180,7 +177,7 @@ impl Carrier { /// Any Python error that occurs while trying to get the current context from Python will /// be returned; this includes import errors when importing `opentelemetry.context` and /// `opentelemetry.propagate`. -pub fn attach_otel_context_from_python(py: Python<'_>) -> PyResult { +pub fn attach_otel_context_from_python(py: Python<'_>) -> PyResult { let get_current_context = py.import("opentelemetry.context")?.getattr("get_current")?; let inject = py.import("opentelemetry.propagate")?.getattr("inject")?; diff --git a/crates/tracing-subscriber/CHANGELOG.md b/crates/tracing-subscriber/CHANGELOG.md index 8f3ab80..b11bf62 100644 --- a/crates/tracing-subscriber/CHANGELOG.md +++ b/crates/tracing-subscriber/CHANGELOG.md @@ -4,18 +4,6 @@ #### ci release flow (#11) -## 0.1.1-rc.1 (2023-12-18) - -### Fixes - -#### ci release flow - -## 0.1.1-rc.0 (2023-12-18) - -### Fixes - -#### ci release flow - ## 0.1.0 (2023-12-16) ### Breaking Changes diff --git a/crates/tracing-subscriber/Cargo.toml b/crates/tracing-subscriber/Cargo.toml index 7d0b2ab..887e5fb 100644 --- a/crates/tracing-subscriber/Cargo.toml +++ b/crates/tracing-subscriber/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-tracing-subscriber" -version = "0.1.1" +version = "0.1.2-dev.1" edition = "2021" categories = ["Python bindings", "OpenTelemetry", "Tracing"] keywords = ["python", "pyo3", "opentelemetry", "tracing"] @@ -8,32 +8,36 @@ license = "Apache-2.0" readme = "./README.md" description = "A Python module for configuring and initializing tracing subscribers from Python." repository = "https://github.com/rigetti/pyo3-opentelemetry" -rust-version = "1.67.0" +rust-version = "1.70.0" [dependencies] handlebars = { version = "4.4.0", optional = true } -pyo3 = { workspace = true } -opentelemetry = { workspace = true, features = ["rt-tokio"] } -opentelemetry-otlp = { version = "0.13.0", features = ["grpc-tonic", "trace", "tls-roots"], optional = true } -opentelemetry-proto = { version = "0.3.0", optional = true, features = ["tonic"] } -opentelemetry-stdout = { version = "0.1.0", optional = true, features = ["trace"] } -opentelemetry_api = { workspace = true } -opentelemetry_sdk = { workspace = true, features = ["rt-tokio-current-thread"] } -pyo3-asyncio = { workspace = true, features = ["tokio-runtime"] } +pyo3 = { workspace = true, optional = true } +opentelemetry = { workspace = true } +# These packages *MUST* be kept in sync with the OTEL package versions; but +# since they are optional, they cannot be workspace dependencies. +opentelemetry-otlp = { version = "0.25.0", features = ["grpc-tonic", "trace", "tls-roots"], optional = true } +opentelemetry-proto = { version = "0.25.0", optional = true, features = ["tonic"] } +opentelemetry_sdk = { workspace = true, features = ["rt-tokio", "rt-tokio-current-thread"] } +pyo3-asyncio = { workspace = true, features = ["tokio-runtime"], optional = true } serde = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread"] } -tonic = { version = "0.9.2", features = ["tls", "tls-roots"], optional = true } +tonic = { version = "0.12.3", features = ["tls", "tls-roots"], optional = true } tracing = { workspace = true } tracing-opentelemetry = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "json"] } +futures-core = "0.3.30" +serde_json = "1.0.128" [features] -layer-otel-otlp = ["dep:opentelemetry-otlp", "dep:opentelemetry-proto", "dep:tonic"] -layer-otel-otlp-file = ["dep:opentelemetry-stdout"] +layer-otel-otlp = ["layer-otel-otlp-file", "dep:tonic"] +layer-otel-otlp-file = ["dep:opentelemetry-otlp", "dep:opentelemetry-proto"] stubs = ["dep:handlebars"] +pyo3 = ["dep:pyo3", "dep:pyo3-asyncio"] +extension-module = ["pyo3", "pyo3/extension-module"] +default = ["extension-module"] [dev-dependencies] rstest = { workspace = true } serde_json = "1.0.107" -tempfile = "3.8.0" diff --git a/crates/tracing-subscriber/assets/python_stubs/__init__.pyi b/crates/tracing-subscriber/assets/python_stubs/__init__.pyi index bfacfbe..0ebc700 100644 --- a/crates/tracing-subscriber/assets/python_stubs/__init__.pyi +++ b/crates/tracing-subscriber/assets/python_stubs/__init__.pyi @@ -15,6 +15,7 @@ from __future__ import annotations from types import TracebackType from typing import TYPE_CHECKING, Optional, Type, final +from . import common as common from . import layers as layers from . import subscriber as subscriber diff --git a/crates/tracing-subscriber/assets/python_stubs/common/__init__.py b/crates/tracing-subscriber/assets/python_stubs/common/__init__.py new file mode 100644 index 0000000..137a842 --- /dev/null +++ b/crates/tracing-subscriber/assets/python_stubs/common/__init__.py @@ -0,0 +1,18 @@ +# ***************************************************************************** +# * AUTO-GENERATED CODE * +# * * +# * This code was generated by the `pyo3-tracing-subscriber` crate. Any * +# * modifications to this file should be made to the script or the generation * +# * process that produced this code. Specifically, see: * +# * `pyo3_tracing_subscriber::stubs::write_stub_files` * +# * * +# * Do not manually edit this file, as your changes may be overwritten the * +# * next time the code is generated. * +# ***************************************************************************** + +from {{ host_package }}.{{ tracing_subscriber_module_name }} import common + + +__doc__ = common.__doc__ +__all__ = getattr(common, "__all__", []) + diff --git a/crates/tracing-subscriber/assets/python_stubs/common/__init__.pyi b/crates/tracing-subscriber/assets/python_stubs/common/__init__.pyi new file mode 100644 index 0000000..0712716 --- /dev/null +++ b/crates/tracing-subscriber/assets/python_stubs/common/__init__.pyi @@ -0,0 +1,45 @@ +# ***************************************************************************** +# * AUTO-GENERATED CODE * +# * * +# * This code was generated by the `pyo3-tracing-subscriber` crate. Any * +# * modifications to this file should be made to the script or the generation * +# * process that produced this code. Specifically, see: * +# * `pyo3_tracing_subscriber::stubs::write_stub_files` * +# * * +# * Do not manually edit this file, as your changes may be overwritten the * +# * next time the code is generated. * +# ***************************************************************************** + +from typing import Dict, Optional, final + + +@final +class InstrumentationLibrary: + """ + Information about a library or crate providing instrumentation. + + An instrumentation library should be named to follow any naming conventions + of the instrumented library (e.g. 'middleware' for a web framework). + + See the `instrumentation libraries `_ + spec for more information. + """ + + def __new__( + cls, + name: str, + version: Optional[str] = None, + schema_url: Optional[str] = None, + attributes: Optional[Dict[str, str]] = None, + ) -> "InstrumentationLibrary": + """ + Initializes a new instance of `InstrumentationLibrary`. + + :param name: The name of the instrumentation library. + :param version: The version of the instrumentation library. + :param schema_url: The `schema URL `_ of + the instrumentation library. + :param attributes: The attributes of the instrumentation library. + """ + ... + diff --git a/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp/__init__.pyi b/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp/__init__.pyi index 5dde690..c720928 100644 --- a/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp/__init__.pyi +++ b/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp/__init__.pyi @@ -12,6 +12,7 @@ from __future__ import annotations from typing import Dict, Optional, TYPE_CHECKING, final +from {{ host_package }}.{{ tracing_subscriber_module_name }}.common import InstrumentationLibrary @final class SpanLimits: @@ -70,6 +71,7 @@ class Config: timeout_millis: Optional[int] = None, pre_shutdown_timeout_millis: Optional[int] = 2000, filter: Optional[str] = None, + instrumentation_library: Optional[InstrumentationLibrary] = None, ) -> "Config": """ Initializes a new `Config`. @@ -94,6 +96,7 @@ class Config: If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported. + :param instrumentation_library: Information about the library providing the tracing instrumentation. """ ... diff --git a/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp_file/__init__.pyi b/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp_file/__init__.pyi index 613126b..31ec3bf 100644 --- a/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp_file/__init__.pyi +++ b/crates/tracing-subscriber/assets/python_stubs/layers/otel_otlp_file/__init__.pyi @@ -11,6 +11,8 @@ # ***************************************************************************** from typing import Optional, final +from {{ host_package }}.{{ tracing_subscriber_module_name }}.common import InstrumentationLibrary + @final class Config: @@ -19,7 +21,7 @@ class Config: layer. """ - def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None) -> "Config": + def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None, instrumentation_library: Optional[InstrumentationLibrary] = None) -> "Config": """ :param file_path: The path to the file to write to. If not specified, defaults to stdout. :param filter: A filter string to use for this layer. This uses the same format as the @@ -30,6 +32,7 @@ class Config: If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported. + :param instrumentation_library: Information about the library providing the tracing instrumentation. """ ... diff --git a/crates/tracing-subscriber/src/common.rs b/crates/tracing-subscriber/src/common.rs index 04dcbd5..699831e 100644 --- a/crates/tracing-subscriber/src/common.rs +++ b/crates/tracing-subscriber/src/common.rs @@ -1,7 +1,12 @@ +use std::borrow::Cow; +use std::collections::HashMap; + +use opentelemetry::InstrumentationLibrary; /// This module contains a number of `rigetti-pyo3` ports which were /// backed out due to build issues involving the `pyo3/extension-module` /// feature. This should be replaced upon resolution of /// . +use pyo3::prelude::*; use pyo3::PyErr; /// A macro for initializing a submodule. @@ -103,3 +108,59 @@ impl ToPythonError for std::convert::Infallible { unreachable!("Infallible can never happen") } } + +#[pyclass(name = "InstrumentationLibrary")] +#[derive(Debug, Clone)] +pub(crate) struct PyInstrumentationLibrary { + name: String, + version: Option, + schema_url: Option, + attributes: HashMap, +} + +#[pymethods] +impl PyInstrumentationLibrary { + #[new] + #[pyo3(signature = (name, /, version=None, schema_url=None, attributes=None))] + fn new( + name: String, + version: Option, + schema_url: Option, + attributes: Option>, + ) -> Self { + let attributes = attributes.unwrap_or_default(); + Self { + name, + version, + schema_url, + attributes, + } + } +} + +impl From for InstrumentationLibrary { + fn from(py_instrumentation_library: PyInstrumentationLibrary) -> Self { + let mut builder = Self::builder(Cow::from(py_instrumentation_library.name)); + if let Some(version) = py_instrumentation_library.version { + builder = builder.with_version(Cow::from(version)); + } + if let Some(schema_url) = py_instrumentation_library.schema_url { + builder = builder.with_schema_url(Cow::from(schema_url)); + } + let mut attributes = Vec::new(); + for (key, value) in py_instrumentation_library.attributes { + let kv = opentelemetry::KeyValue::new( + opentelemetry::Key::new(key), + opentelemetry::Value::from(value), + ); + attributes.push(kv); + } + builder = builder.with_attributes(attributes); + + builder.build() + } +} + +create_init_submodule! { + classes: [ PyInstrumentationLibrary ], +} diff --git a/crates/tracing-subscriber/src/contextmanager.rs b/crates/tracing-subscriber/src/contextmanager.rs index bc4cf22..e49f3ea 100644 --- a/crates/tracing-subscriber/src/contextmanager.rs +++ b/crates/tracing-subscriber/src/contextmanager.rs @@ -185,15 +185,22 @@ impl Tracing { #[cfg(feature = "layer-otel-otlp-file")] #[cfg(test)] mod test { - use std::{io::BufRead, thread::sleep, time::Duration}; + use std::{ + env::temp_dir, + io::BufRead, + path::PathBuf, + thread::sleep, + time::{Duration, SystemTime, UNIX_EPOCH}, + }; use tokio::runtime::Builder; use crate::{ contextmanager::{CurrentThreadTracingConfig, GlobalTracingConfig, TracingConfig}, - export_process::{BatchConfig, ExportProcess, ExportProcessConfig, SimpleConfig}, + export_process::{ExportProcess, ExportProcessConfig, SimpleConfig}, subscriber::TracingSubscriberRegistryConfig, }; + use opentelemetry_proto::tonic::trace::v1 as otlp; #[tracing::instrument] fn example() { @@ -203,108 +210,15 @@ mod test { const N_SPANS: usize = 5; const SPAN_DURATION: Duration = Duration::from_millis(100); - /// A truncated implementation of `opentelemetry_stdout` that derives - /// `serde::Deserialize`. - #[derive(serde::Deserialize)] - #[serde(rename_all = "camelCase")] - struct SpanData { - resource_spans: Vec, - } - - #[derive(serde::Deserialize)] - #[serde(rename_all = "camelCase")] - struct ResourceSpan { - scope_spans: Vec, - } - - #[derive(serde::Deserialize)] - struct ScopeSpan { - spans: Vec, - } - - #[derive(serde::Deserialize, Clone)] - #[serde(rename_all = "camelCase")] - struct Span { - name: String, - start_time_unix_nano: u128, - end_time_unix_nano: u128, - } - - #[test] - /// Test that a global batch process can be started and stopped and that it exports - /// accurate spans as configured. - fn test_global_batch() { - let temporary_file = tempfile::NamedTempFile::new().unwrap(); - let temporary_file_path = temporary_file.path().to_owned(); - let layer_config = Box::new(crate::layers::otel_otlp_file::Config { - file_path: Some(temporary_file_path.as_os_str().to_str().unwrap().to_owned()), - filter: Some("error,pyo3_tracing_subscriber=info".to_string()), - }); - let subscriber = Box::new(TracingSubscriberRegistryConfig { layer_config }); - let config = TracingConfig::Global(GlobalTracingConfig { - export_process: ExportProcessConfig::Batch(BatchConfig { - subscriber: crate::subscriber::PyConfig { - subscriber_config: subscriber, - }, - }), - }); - let export_process = ExportProcess::start(config).unwrap(); - let rt2 = Builder::new_current_thread().enable_time().build().unwrap(); - let _guard = rt2.enter(); - let export_runtime = rt2 - .block_on(tokio::time::timeout(Duration::from_secs(1), async move { - for _ in 0..N_SPANS { - example(); - } - export_process.shutdown().await - })) - .unwrap() - .unwrap() - .unwrap(); - drop(export_runtime); - - let reader = std::io::BufReader::new(std::fs::File::open(temporary_file_path).unwrap()); - let lines = reader.lines(); - let spans = lines - .flat_map(|line| { - let line = line.unwrap(); - let span_data: SpanData = serde_json::from_str(line.as_str()).unwrap(); - span_data - .resource_spans - .iter() - .flat_map(|resource_span| { - resource_span - .scope_spans - .iter() - .flat_map(|scope_span| scope_span.spans.clone()) - }) - .collect::>() - }) - .collect::>(); - assert_eq!(spans.len(), N_SPANS); - - let span_grace = Duration::from_millis(200); - for span in spans { - assert_eq!(span.name, "example"); - assert!( - span.end_time_unix_nano - span.start_time_unix_nano >= SPAN_DURATION.as_nanos() - ); - assert!( - (span.end_time_unix_nano - span.start_time_unix_nano) - <= (SPAN_DURATION.as_nanos() + span_grace.as_nanos()) - ); - } - } - #[test] /// Test that a global simple export process can be started and stopped and that it /// exports accurate spans as configured. fn test_global_simple() { - let temporary_file = tempfile::NamedTempFile::new().unwrap(); - let temporary_file_path = temporary_file.path().to_owned(); + let temporary_file_path = get_tempfile("test_global_simple"); let layer_config = Box::new(crate::layers::otel_otlp_file::Config { file_path: Some(temporary_file_path.as_os_str().to_str().unwrap().to_owned()), filter: Some("error,pyo3_tracing_subscriber=info".to_string()), + instrumentation_library: None, }); let subscriber = Box::new(TracingSubscriberRegistryConfig { layer_config }); let config = TracingConfig::Global(GlobalTracingConfig { @@ -333,7 +247,8 @@ mod test { let spans = lines .flat_map(|line| { let line = line.unwrap(); - let span_data: SpanData = serde_json::from_str(line.as_str()).unwrap(); + let span_data: otlp::TracesData = + serde_json::from_str(line.as_str().trim()).unwrap(); span_data .resource_spans .iter() @@ -343,33 +258,45 @@ mod test { .iter() .flat_map(|scope_span| scope_span.spans.clone()) }) - .collect::>() + .collect::>() }) - .collect::>(); + .collect::>(); assert_eq!(spans.len(), N_SPANS); - let span_grace = Duration::from_millis(10); + let span_grace = Duration::from_millis(50); for span in spans { assert_eq!(span.name, "example"); assert!( - span.end_time_unix_nano - span.start_time_unix_nano >= SPAN_DURATION.as_nanos() + (span.end_time_unix_nano - span.start_time_unix_nano) as u128 + >= SPAN_DURATION.as_nanos() ); assert!( - (span.end_time_unix_nano - span.start_time_unix_nano) + (span.end_time_unix_nano - span.start_time_unix_nano) as u128 <= (SPAN_DURATION.as_nanos() + span_grace.as_nanos()) ); } } + fn get_tempfile(prefix: &str) -> PathBuf { + let timestamp = SystemTime::now() + .duration_since(UNIX_EPOCH) + .expect("should be able to get current time") + .as_nanos(); + let dir = temp_dir(); + dir.join(std::path::Path::new( + format!("{prefix}-{timestamp}.txt").as_str(), + )) + } + #[test] /// Test that a current thread simple export process can be started and stopped and that it /// exports accurate spans as configured. fn test_current_thread_simple() { - let temporary_file = tempfile::NamedTempFile::new().unwrap(); - let temporary_file_path = temporary_file.path().to_owned(); + let temporary_file_path = get_tempfile("test_current_thread_simple"); let layer_config = Box::new(crate::layers::otel_otlp_file::Config { file_path: Some(temporary_file_path.as_os_str().to_str().unwrap().to_owned()), filter: Some("error,pyo3_tracing_subscriber=info".to_string()), + instrumentation_library: None, }); let subscriber = Box::new(TracingSubscriberRegistryConfig { layer_config }); let config = TracingConfig::CurrentThread(CurrentThreadTracingConfig { @@ -400,7 +327,7 @@ mod test { let spans = lines .flat_map(|line| { let line = line.unwrap(); - let span_data: SpanData = serde_json::from_str(line.as_str()).unwrap(); + let span_data: otlp::TracesData = serde_json::from_str(line.as_str()).unwrap(); span_data .resource_spans .iter() @@ -410,19 +337,20 @@ mod test { .iter() .flat_map(|scope_span| scope_span.spans.clone()) }) - .collect::>() + .collect::>() }) - .collect::>(); + .collect::>(); assert_eq!(spans.len(), N_SPANS); let span_grace = Duration::from_millis(50); for span in spans { assert_eq!(span.name, "example"); assert!( - span.end_time_unix_nano - span.start_time_unix_nano >= SPAN_DURATION.as_nanos() + (span.end_time_unix_nano - span.start_time_unix_nano) as u128 + >= SPAN_DURATION.as_nanos() ); assert!( - (span.end_time_unix_nano - span.start_time_unix_nano) + (span.end_time_unix_nano - span.start_time_unix_nano) as u128 <= (SPAN_DURATION.as_nanos() + span_grace.as_nanos()) ); } diff --git a/crates/tracing-subscriber/src/export_process/background.rs b/crates/tracing-subscriber/src/export_process/background.rs index 3ca8273..a8a63c1 100644 --- a/crates/tracing-subscriber/src/export_process/background.rs +++ b/crates/tracing-subscriber/src/export_process/background.rs @@ -42,7 +42,7 @@ pub(crate) struct ExportProcess { } impl ExportProcess { - fn new(guard: SubscriberManagerGuard, runtime: Runtime) -> Self { + const fn new(guard: SubscriberManagerGuard, runtime: Runtime) -> Self { Self { runtime, guard } } diff --git a/crates/tracing-subscriber/src/layers/mod.rs b/crates/tracing-subscriber/src/layers/mod.rs index 502de60..254563b 100644 --- a/crates/tracing-subscriber/src/layers/mod.rs +++ b/crates/tracing-subscriber/src/layers/mod.rs @@ -19,7 +19,7 @@ //! //! * [`crate::layers::fmt_file::Config`] - a layer which writes spans to a file (or stdout) in //! * [`crate::layers::otel_otlp_file::Config`] - a layer which writes spans to a file (or stdout) in -//! the `OpenTelemetry` OTLP JSON-serialized format. +//! the `OpenTelemetry` OTLP JSON-serialized format. //! * [`crate::layers::otel_otlp::Config`] - a layer which exports spans to an `OpenTelemetry` collector. pub(crate) mod fmt_file; #[cfg(feature = "layer-otel-otlp")] diff --git a/crates/tracing-subscriber/src/layers/otel_otlp.rs b/crates/tracing-subscriber/src/layers/otel_otlp.rs index cc5300d..51b5403 100644 --- a/crates/tracing-subscriber/src/layers/otel_otlp.rs +++ b/crates/tracing-subscriber/src/layers/otel_otlp.rs @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::{collections::HashMap, time::Duration}; +use std::{collections::HashMap, sync::Arc, time::Duration}; -use opentelemetry_api::{trace::TraceError, KeyValue}; +use opentelemetry::{trace::TracerProvider, InstrumentationLibrary}; use opentelemetry_otlp::{TonicExporterBuilder, WithExportConfig}; use opentelemetry_sdk::{ trace::{Sampler, SpanLimits}, Resource, }; use pyo3::prelude::*; +use tracing_subscriber::Layer; use crate::create_init_submodule; use opentelemetry_sdk::trace; @@ -28,12 +29,10 @@ use tonic::metadata::{ errors::{InvalidMetadataKey, InvalidMetadataValue}, MetadataKey, }; -use tracing_subscriber::{ - filter::{FromEnvError, ParseError}, - Layer, -}; +use tracing_subscriber::filter::{FromEnvError, ParseError}; use super::{build_env_filter, force_flush_provider_as_shutdown, LayerBuildResult, WithShutdown}; +use crate::common::PyInstrumentationLibrary; /// Configures the [`opentelemetry-otlp`] crate layer. #[derive(Clone, Debug)] @@ -57,11 +56,13 @@ pub(crate) struct Config { pre_shutdown_timeout: Duration, /// The filter to use for the [`tracing_subscriber::filter::EnvFilter`] layer. filter: Option, + /// The instrumentation library to use for the [`opentelemetry::sdk::trace::TracerProvider`]. + instrumentation_library: Option, } impl Config { fn initialize_otlp_exporter(&self) -> TonicExporterBuilder { - let mut otlp_exporter = opentelemetry_otlp::new_exporter().tonic().with_env(); + let mut otlp_exporter = opentelemetry_otlp::new_exporter().tonic(); if let Some(endpoint) = self.endpoint.clone() { otlp_exporter = otlp_exporter.with_endpoint(endpoint); } @@ -96,22 +97,27 @@ impl Config { .tracing() .with_exporter(self.initialize_otlp_exporter()) .with_trace_config( - trace::config() + trace::Config::default() .with_sampler(self.sampler.clone()) .with_span_limits(self.span_limits) .with_resource(self.resource.clone()), ); - let tracer = if batch { - pipeline.install_batch(opentelemetry::runtime::Tokio) + let provider = if batch { + pipeline.install_batch(opentelemetry_sdk::runtime::Tokio {}) } else { pipeline.install_simple() } .map_err(BuildError::from)?; - let provider = tracer - .provider() - .ok_or(BuildError::ProviderNotSetOnTracer)?; let env_filter = build_env_filter(self.filter.clone())?; + + let tracer = self.instrumentation_library.as_ref().map_or_else( + || provider.tracer("pyo3_tracing_subscriber"), + |instrumentation_library| { + provider.library_tracer(Arc::new(instrumentation_library.clone())) + }, + ); + let layer = tracing_opentelemetry::layer() .with_tracer(tracer) .with_filter(env_filter); @@ -131,9 +137,7 @@ pub(super) enum Error { #[derive(thiserror::Error, Debug)] pub(crate) enum BuildError { #[error("failed to build opentelemetry-otlp pipeline: {0}")] - BatchInstall(#[from] TraceError), - #[error("provider not set on returned opentelemetry-otlp tracer")] - ProviderNotSetOnTracer, + TraceInstall(#[from] opentelemetry::trace::TraceError), #[error("error in the configuration: {0}")] Config(#[from] ConfigError), #[error("failed to parse specified trace filter: {0}")] @@ -240,6 +244,7 @@ pub(crate) struct PyConfig { timeout_millis: Option, pre_shutdown_timeout_millis: u64, filter: Option, + instrumentation_library: Option, } #[pymethods] @@ -254,7 +259,8 @@ impl PyConfig { endpoint = None, timeout_millis = None, pre_shutdown_timeout_millis = 2000, - filter = None + filter = None, + instrumentation_library = None ))] #[allow(clippy::too_many_arguments)] fn new( @@ -266,6 +272,7 @@ impl PyConfig { timeout_millis: Option, pre_shutdown_timeout_millis: u64, filter: Option<&str>, + instrumentation_library: Option, ) -> PyResult { Ok(Self { span_limits: span_limits.unwrap_or_default(), @@ -276,6 +283,7 @@ impl PyConfig { timeout_millis, pre_shutdown_timeout_millis, filter: filter.map(String::from), + instrumentation_library, }) } } @@ -304,8 +312,8 @@ impl From for Resource { let kvs = resource .attrs .into_iter() - .map(|(k, v)| KeyValue::new(k, v)) - .collect::>(); + .map(|(k, v)| opentelemetry::KeyValue::new(k, v)) + .collect::>(); match resource.schema_url { Some(schema_url) => Self::from_schema_url(kvs, schema_url), None => Self::new(kvs), @@ -339,7 +347,7 @@ pub(crate) enum PyResourceValueArray { String(Vec), } -impl From for opentelemetry_api::Array { +impl From for opentelemetry::Array { fn from(py_resource_value_array: PyResourceValueArray) -> Self { match py_resource_value_array { PyResourceValueArray::Bool(b) => Self::Bool(b), @@ -352,7 +360,7 @@ impl From for opentelemetry_api::Array { } } -impl From for opentelemetry_api::Value { +impl From for opentelemetry::Value { fn from(py_resource_value: PyResourceValue) -> Self { match py_resource_value { PyResourceValue::Bool(b) => Self::Bool(b), @@ -448,6 +456,7 @@ impl TryFrom for Config { timeout: config.timeout_millis.map(Duration::from_millis), pre_shutdown_timeout: Duration::from_millis(config.pre_shutdown_timeout_millis), filter: config.filter, + instrumentation_library: config.instrumentation_library.map(Into::into), }) } } diff --git a/crates/tracing-subscriber/src/layers/otel_otlp_file.rs b/crates/tracing-subscriber/src/layers/otel_otlp_file.rs index 102407e..088cf24 100644 --- a/crates/tracing-subscriber/src/layers/otel_otlp_file.rs +++ b/crates/tracing-subscriber/src/layers/otel_otlp_file.rs @@ -12,12 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::{io::Write, sync::Arc}; + use crate::create_init_submodule; -use opentelemetry_api::trace::TracerProvider; +use futures_core::future::BoxFuture; +use opentelemetry::trace::TraceError; +use opentelemetry_proto::transform::{ + common::tonic::ResourceAttributesWithSchema, trace::tonic::group_spans_by_resource_and_scope, +}; use pyo3::prelude::*; -use tracing_subscriber::Layer; use super::{build_env_filter, force_flush_provider_as_shutdown, LayerBuildResult, WithShutdown}; +use crate::common::PyInstrumentationLibrary; +use tracing_subscriber::Layer; /// Configures the [`opentelemetry-stdout`] crate layer. If [`file_path`] is None, the layer /// will write to stdout. @@ -26,14 +33,100 @@ use super::{build_env_filter, force_flush_provider_as_shutdown, LayerBuildResult pub(crate) struct Config { pub(crate) file_path: Option, pub(crate) filter: Option, + pub(crate) instrumentation_library: Option, } #[pymethods] impl Config { #[new] - #[pyo3(signature = (/, file_path = None, filter = None))] - const fn new(file_path: Option, filter: Option) -> Self { - Self { file_path, filter } + #[pyo3(signature = (/, file_path = None, filter = None, instrumentation_library = None))] + const fn new( + file_path: Option, + filter: Option, + instrumentation_library: Option, + ) -> Self { + Self { + file_path, + filter, + instrumentation_library, + } + } +} + +#[derive(Debug)] +struct OtelOtlpFile { + writer: Option>>, + resource: ResourceAttributesWithSchema, +} + +impl OtelOtlpFile { + fn new(writer: Option) -> Self { + Self { + writer: writer.map(|writer| Arc::new(tokio::sync::Mutex::new(writer))), + resource: ResourceAttributesWithSchema::default(), + } + } +} + +impl opentelemetry_sdk::export::trace::SpanExporter for OtelOtlpFile { + fn export( + &mut self, + batch: Vec, + ) -> BoxFuture<'static, opentelemetry_sdk::export::trace::ExportResult> { + let writer = self.writer.clone(); + let resource_spans = group_spans_by_resource_and_scope(batch, &self.resource); + + Box::pin(async move { + let traces_data = opentelemetry_proto::tonic::trace::v1::TracesData { resource_spans }; + let serialized = + serde_json::to_vec(&traces_data).map_err(|e| TraceError::Other(Box::new(e)))?; + if let Some(writer) = writer { + let mut writer = writer.lock().await; + writer + .write(serialized.as_slice()) + .map(|_| ()) + .map_err(|e| TraceError::Other(Box::new(e)))?; + writer + .write(b"\n") + .map(|_| ()) + .map_err(|e| TraceError::Other(Box::new(e))) + } else { + let mut stdout = std::io::stdout().lock(); + stdout + .write(serialized.as_slice()) + .map(|_| ()) + .map_err(|e| TraceError::Other(Box::new(e)))?; + stdout + .write(b"\n") + .map(|_| ()) + .map_err(|e| TraceError::Other(Box::new(e))) + } + }) + } + + fn shutdown(&mut self) {} + + fn force_flush( + &mut self, + ) -> BoxFuture<'static, opentelemetry_sdk::export::trace::ExportResult> { + let writer = self.writer.clone(); + Box::pin(async move { + match writer { + Some(writer) => writer + .lock() + .await + .flush() + .map_err(|e| TraceError::Other(Box::new(e))), + None => std::io::stdout() + .flush() + .map_err(|e| TraceError::Other(Box::new(e))), + } + }) + } + + /// Set the resource for the exporter. + fn set_resource(&mut self, resource: &opentelemetry_sdk::Resource) { + self.resource = ResourceAttributesWithSchema::from(resource); } } @@ -43,24 +136,30 @@ impl crate::layers::Config for Config { } fn build(&self, batch: bool) -> LayerBuildResult { - let exporter_builder = opentelemetry_stdout::SpanExporter::builder(); - let exporter_builder = match self.file_path.as_ref() { - Some(file_path) => { - let file = std::fs::File::create(file_path).map_err(BuildError::from)?; - exporter_builder.with_writer(file) - } - None => exporter_builder, - }; + use opentelemetry::trace::TracerProvider as _; + let file = self + .file_path + .as_ref() + .map(|file_path| std::fs::File::create(file_path).map_err(BuildError::from)) + .transpose()?; + + let exporter = OtelOtlpFile::new(file); let provider = if batch { opentelemetry_sdk::trace::TracerProvider::builder() - .with_batch_exporter(exporter_builder.build(), opentelemetry::runtime::Tokio) + .with_batch_exporter(exporter, opentelemetry_sdk::runtime::Tokio {}) .build() } else { opentelemetry_sdk::trace::TracerProvider::builder() - .with_simple_exporter(exporter_builder.build()) + .with_simple_exporter(exporter) .build() }; - let tracer = provider.tracer("stdout"); + + let tracer = self.instrumentation_library.as_ref().map_or_else( + || provider.tracer("pyo3_tracing_subscriber"), + |instrumentation_library| { + provider.library_tracer(Arc::new(instrumentation_library.clone().into())) + }, + ); let env_filter = build_env_filter(self.filter.clone())?; let layer = tracing_opentelemetry::layer() .with_tracer(tracer) diff --git a/crates/tracing-subscriber/src/lib.rs b/crates/tracing-subscriber/src/lib.rs index 9b80d8d..32c1a5b 100644 --- a/crates/tracing-subscriber/src/lib.rs +++ b/crates/tracing-subscriber/src/lib.rs @@ -16,7 +16,6 @@ #![deny(clippy::all)] #![deny(clippy::pedantic)] #![deny(clippy::cargo)] -#![allow(clippy::multiple_crate_versions)] #![warn(clippy::nursery)] // Has false positives that conflict with unreachable_pub #![allow(clippy::redundant_pub_crate)] @@ -38,7 +37,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - pointer_structural_match, private_interfaces, private_bounds, semicolon_in_expressions_from_macros, @@ -63,21 +61,23 @@ //! //! # Features //! +//! * `pyo3` - enables the Python bindings for the tracing subscriber. This feature is enabled by default. +//! * `extension-module` - enables the Python extension module for the tracing subscriber. This feature is enabled by default. //! * `layer-otel-otlp-file` - exports trace data with `opentelemetry-stdout`. See `crate::layers::otel_otlp_file`. //! * `layer-otel-otlp` - exports trace data with `opentelemetry-otlp`. See `crate::layers::otel_otlp`. -//! * `stubs` - supports writing stub files in your Python source code from your Rust build scripts. See `crates::stubs` +//! * `stubs` - supports writing stub files in your Python source code from your Rust build scripts. See `crates::stubs`. This should only be used in build scripts with default features disabled. //! //! # Requirements and Limitations //! //! * The tracing subscribers initialized and configured _only_ capture tracing data for the pyo3 -//! library which adds the `pyo3-tracing-subscriber` module. Separate Python libraries require separate -//! bootstrapping. +//! library which adds the `pyo3-tracing-subscriber` module. Separate Python libraries require separate +//! bootstrapping. //! * Python users can initialize tracing subscribers using context managers either globally, in -//! which case they can only initialize once, or per-thread, which is incompatible with Python -//! `async/await`. +//! which case they can only initialize once, or per-thread, which is incompatible with Python +//! `async/await`. //! * The `OTel` OTLP layer requires a heuristic based timeout upon context manager exit to ensure -//! trace data on the Rust side is flushed to the OTLP collector. This issue currently persists despite calls -//! to `force_flush` on the `opentelemetry_sdk::trace::TracerProvider` and `opentelemetry::global::shutdown_tracer_provider`. +//! trace data on the Rust side is flushed to the OTLP collector. This issue currently persists despite calls +//! to `force_flush` on the `opentelemetry_sdk::trace::TracerProvider` and `opentelemetry::global::shutdown_tracer_provider`. //! //! # Examples //! @@ -111,7 +111,8 @@ //! //! async main(): //! async with Tracing(): -//! # do stuff +//! +//! # do stuff //! pass //! //! @@ -122,22 +123,31 @@ //! # Related Crates //! //! * `pyo3-opentelemetry` - propagates `OpenTelemetry` contexts from Python into Rust. +#[cfg(feature = "pyo3")] use pyo3::{types::PyModule, PyResult, Python}; +#[cfg(feature = "pyo3")] use self::{ contextmanager::{CurrentThreadTracingConfig, GlobalTracingConfig, TracingContextManagerError}, export_process::{BatchConfig, SimpleConfig, TracingShutdownError, TracingStartError}, }; +#[cfg(feature = "pyo3")] pub use contextmanager::Tracing; +#[cfg(feature = "pyo3")] pub(crate) mod common; +#[cfg(feature = "pyo3")] mod contextmanager; +#[cfg(feature = "pyo3")] mod export_process; +#[cfg(feature = "pyo3")] pub(crate) mod layers; #[cfg(feature = "stubs")] pub mod stubs; +#[cfg(feature = "pyo3")] pub(crate) mod subscriber; +#[cfg(feature = "pyo3")] create_init_submodule! { classes: [ Tracing, @@ -149,20 +159,22 @@ create_init_submodule! { errors: [TracingContextManagerError, TracingStartError, TracingShutdownError], submodules: [ "layers": layers::init_submodule, - "subscriber": subscriber::init_submodule + "subscriber": subscriber::init_submodule, + "common": common::init_submodule ], } +#[cfg(feature = "pyo3")] /// Add the tracing submodule to the given module. This will add the submodule to the `sys.modules` /// dictionary so that it can be imported from Python. /// /// # Arguments /// /// * `fully_qualified_namespace` - the fully qualified namespace of the parent Python module to -/// which the tracing submodule should be added. This may be a nested namespace, such as -/// `my_package.my_module`. +/// which the tracing submodule should be added. This may be a nested namespace, such as +/// `my_package.my_module`. /// * `name` - the name of the tracing subscriber submodule within the specified parent module. -/// This should not be a nested namespace. +/// This should not be a nested namespace. /// * `py` - the Python GIL token. /// * `parent_module` - the parent module to which the tracing subscriber submodule should be added. /// @@ -176,34 +188,34 @@ create_init_submodule! { /// /// * `Tracing` - a Python context manager which initializes the configured tracing subscriber. /// * `GlobalTracingConfig` - a Python context manager which sets the configured tracing subscriber -/// as the global default (ie `tracing::subscriber::set_global_default`). The `Tracing` context -/// manager can be used _only once_ per process with this configuration. +/// as the global default (ie `tracing::subscriber::set_global_default`). The `Tracing` context +/// manager can be used _only once_ per process with this configuration. /// * `CurrentThreadTracingConfig` - a Python context manager which sets the configured tracing -/// subscriber as the current thread default (ie `tracing::subscriber::set_default`). As the -/// context manager exits, the guard is dropped and the tracing subscriber can be re-initialized -/// with another default. Note, the default tracing subscriber will _not_ capture traces across -/// `async/await` boundaries that call `pyo3_asyncio::tokio::future_into_py`. +/// subscriber as the current thread default (ie `tracing::subscriber::set_default`). As the +/// context manager exits, the guard is dropped and the tracing subscriber can be re-initialized +/// with another default. Note, the default tracing subscriber will _not_ capture traces across +/// `async/await` boundaries that call `pyo3_asyncio::tokio::future_into_py`. /// * `BatchConfig` - a Python context manager which configures the tracing subscriber to export -/// trace data in batch. As the `Tracing` context manager enters, a Tokio runtime is initialized -/// and will run in the background until the context manager exits. +/// trace data in batch. As the `Tracing` context manager enters, a Tokio runtime is initialized +/// and will run in the background until the context manager exits. /// * `SimpleConfig` - a Python context manager which configures the tracing subscriber to export -/// trace data in a non-batch manner. This only initializes a Tokio runtime if the underlying layer -/// requires an asynchronous runtime to export trace data (ie the `opentelemetry-otlp` layer). +/// trace data in a non-batch manner. This only initializes a Tokio runtime if the underlying layer +/// requires an asynchronous runtime to export trace data (ie the `opentelemetry-otlp` layer). /// * `layers` - a submodule which contains different layers to add to the tracing subscriber. -/// Currently supported: +/// Currently supported: /// * `tracing::fmt` - a layer which exports trace data to stdout in a non-OpenTelemetry data format. /// * `opentelemetry-stdout` - a layer which exports trace data to stdout (requires the `layer-otel-otlp-file` feature). /// * `opentelemetry-otlp` - a layer which exports trace data to an `OpenTelemetry` collector (requires the `layer-otel-otlp` feature). /// * `subscriber` - a submodule which contains utilities for initialing the tracing subscriber -/// with the configured layer. Currently, the tracing subscriber is initialized as -/// `tracing::subscriber::Registry::default().with(layer)`. +/// with the configured layer. Currently, the tracing subscriber is initialized as +/// `tracing::subscriber::Registry::default().with(layer)`. /// /// The following exceptions are added to the submodule: /// /// * `TracingContextManagerError` - raised when the `Tracing` context manager's methods are not -/// invoked in the correct order or multiplicity. +/// invoked in the correct order or multiplicity. /// * `TracingStartError` - raised if the user-specified tracing layer or subscriber fails to build -/// and initialize properly upon context manager entry. +/// and initialize properly upon context manager entry. /// * `TracingShutdownError` - raised if the tracing layer or subscriber fails to shutdown properly on context manager exit. /// /// For detailed Python usage documentation, see the stub files written by diff --git a/crates/tracing-subscriber/src/stubs.rs b/crates/tracing-subscriber/src/stubs.rs index ffec339..d13417f 100644 --- a/crates/tracing-subscriber/src/stubs.rs +++ b/crates/tracing-subscriber/src/stubs.rs @@ -37,7 +37,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - pointer_structural_match, semicolon_in_expressions_from_macros, trivial_casts, trivial_numeric_casts, @@ -150,7 +149,7 @@ macro_rules! include_stub_and_init { /// /// * `host_package` - The name of the host Python package. /// * `tracing_subscriber_module_name` - The name of the tracing subscriber module (ie the Python -/// module that will contain the stub files). +/// module that will contain the stub files). /// * `directory` - The directory to write the stub files to. /// * `layer_otel_otlp_file` - Whether to include stub files for the `otel_otlp_file` layer. /// * `layer_otel_otlp` - Whether to include stub files for the `otel_otlp` layer. @@ -174,6 +173,7 @@ pub fn write_stub_files( ) .map_err(Box::new) .map_err(Error::from)?; + include_stub_and_init!(directory, "common/", hb); include_stub_and_init!(directory, "subscriber/", hb); include_stub_and_init!(directory, "layers/", hb); include_stub_and_init!(directory, "layers/file/", hb); diff --git a/deny.toml b/deny.toml index 80db5c7..2cd0166 100644 --- a/deny.toml +++ b/deny.toml @@ -14,14 +14,8 @@ db-path = "~/.cargo/advisory-db" # The url(s) of the advisory databases to use db-urls = ["https://github.com/rustsec/advisory-db"] -# The lint level for security vulnerabilities -vulnerability = "deny" -# The lint level for unmaintained crates -unmaintained = "deny" # The lint level for crates that have been yanked from their source registry yanked = "deny" -# The lint level for crates with security notices. -notice = "deny" # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. #ignore = [ @@ -33,7 +27,6 @@ notice = "deny" # https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html [licenses] unused-allowed-license = "allow" -unlicensed = "deny" allow = [ "Apache-2.0", "ISC", @@ -44,32 +37,30 @@ allow = [ "Unicode-DFS-2016", "Apache-2.0 WITH LLVM-exception", ] -# List of explictly disallowed licenses -# See https://spdx.org/licenses/ for list of possible licenses -# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. -deny = [ - #"Nokia", -] # Lint level for licenses considered copyleft -copyleft = "deny" -allow-osi-fsf-free = "neither" -default = "deny" confidence-threshold = 0.8 -exceptions = [ -] [licenses.private] # If true, ignores workspace crates that aren't published, or are only # published to private registries ignore = true +[[licenses.clarify]] +name = "ring" +expression = "MIT AND ISC AND OpenSSL" +license-files = [ + { path = "LICENSE", hash = 0xbd0eed23 } +] + # This section is considered when running `cargo deny check bans`. # More documentation about the 'bans' section can be found here: # https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html [bans] -multiple-versions = "warn" -wildcards = "warn" -# allow-wildcard-paths = true +# clippy::cargo now handles multiple versions; we don't need two +# tools barking at us for the same thing +multiple-versions = "allow" +wildcards = "deny" +allow-wildcard-paths = true highlight = "all" skip-tree = [] # This section is considered when running `cargo deny check sources`. diff --git a/examples/pyo3-opentelemetry-lib/Cargo.toml b/examples/pyo3-opentelemetry-lib/Cargo.toml index f5f6fea..2e76564 100644 --- a/examples/pyo3-opentelemetry-lib/Cargo.toml +++ b/examples/pyo3-opentelemetry-lib/Cargo.toml @@ -18,9 +18,8 @@ name = "pyo3_opentelemetry_lib" crate-type = ["cdylib", "rlib"] [dependencies] -opentelemetry = "0.20.0" -opentelemetry_api = "0.20.0" -opentelemetry_sdk = "0.20.0" +opentelemetry = { workspace = true } +opentelemetry_sdk = { workspace = true } pyo3 = { workspace = true } pyo3-asyncio = { workspace = true, features = ["tokio", "tokio-runtime"] } pyo3-opentelemetry = { path = "../../crates/opentelemetry" } @@ -32,6 +31,6 @@ tracing-subscriber = { version = "0.3.17", features = ["env-filter"], optional = [features] [build-dependencies] -pyo3-tracing-subscriber = { path = "../../crates/tracing-subscriber", features = ["layer-otel-otlp-file", "layer-otel-otlp", "stubs"] } +pyo3-tracing-subscriber = { path = "../../crates/tracing-subscriber", features = ["layer-otel-otlp-file", "layer-otel-otlp", "stubs"], default-features = false } pyo3-build-config.workspace = true diff --git a/examples/pyo3-opentelemetry-lib/Makefile.toml b/examples/pyo3-opentelemetry-lib/Makefile.toml index 09e6b39..c013b38 100644 --- a/examples/pyo3-opentelemetry-lib/Makefile.toml +++ b/examples/pyo3-opentelemetry-lib/Makefile.toml @@ -6,8 +6,7 @@ dependencies = ["python-install-dependencies"] script = ''' poetry run maturin develop - poetry run black . - poetry run ruff . --fix + cargo make python-format ''' [tasks.python-format] @@ -29,6 +28,7 @@ [tasks.python-test] dependencies = ["python-build"] script = ''' + mkdir -p pyo3_opentelemetry_lib/test/__artifacts__ poetry run pytest . # Note, the follow are all tests that initialize a global tracing subscriber, which is only possible to do @@ -36,15 +36,13 @@ # separate process; that proved non-trivial on a first attempt, as the tests ran into sevaral unexpected # failures. - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_file_export[2]' --with-global-tracing-configuration - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_file_export[3]' --with-global-tracing-configuration - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_file_export_async[0]' --with-global-tracing-configuration - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_file_export_async[1]' --with-global-tracing-configuration + poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_file_export[01]' --with-global-tracing-configuration + poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_file_export_asynchronous[00]' --with-global-tracing-configuration - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export[config2]' --with-global-tracing-configuration - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export[config3]' --with-global-tracing-configuration - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export_async[config0]' --with-global-tracing-configuration - poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export_async[config1]' --with-global-tracing-configuration + poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export[02]' --with-global-tracing-configuration + poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export[03]' --with-global-tracing-configuration + poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export_asynchronous[00]' --with-global-tracing-configuration + poetry run pytest 'pyo3_opentelemetry_lib/test/tracing_test.py::test_otlp_export_asynchronous[01]' --with-global-tracing-configuration ''' [tasks.python-check-all] diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.py index 0993fc1..5b14109 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.py +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.py @@ -12,6 +12,5 @@ from pyo3_opentelemetry_lib import _tracing_subscriber - __doc__ = _tracing_subscriber.__doc__ __all__ = getattr(_tracing_subscriber, "__all__", []) diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.pyi b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.pyi index bfacfbe..0ebc700 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.pyi +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/__init__.pyi @@ -15,6 +15,7 @@ from __future__ import annotations from types import TracebackType from typing import TYPE_CHECKING, Optional, Type, final +from . import common as common from . import layers as layers from . import subscriber as subscriber diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/common/__init__.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/common/__init__.py new file mode 100644 index 0000000..1b06751 --- /dev/null +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/common/__init__.py @@ -0,0 +1,16 @@ +# ***************************************************************************** +# * AUTO-GENERATED CODE * +# * * +# * This code was generated by the `pyo3-tracing-subscriber` crate. Any * +# * modifications to this file should be made to the script or the generation * +# * process that produced this code. Specifically, see: * +# * `pyo3_tracing_subscriber::stubs::write_stub_files` * +# * * +# * Do not manually edit this file, as your changes may be overwritten the * +# * next time the code is generated. * +# ***************************************************************************** + +from pyo3_opentelemetry_lib._tracing_subscriber import common + +__doc__ = common.__doc__ +__all__ = getattr(common, "__all__", []) diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/common/__init__.pyi b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/common/__init__.pyi new file mode 100644 index 0000000..6395b5e --- /dev/null +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/common/__init__.pyi @@ -0,0 +1,43 @@ +# ***************************************************************************** +# * AUTO-GENERATED CODE * +# * * +# * This code was generated by the `pyo3-tracing-subscriber` crate. Any * +# * modifications to this file should be made to the script or the generation * +# * process that produced this code. Specifically, see: * +# * `pyo3_tracing_subscriber::stubs::write_stub_files` * +# * * +# * Do not manually edit this file, as your changes may be overwritten the * +# * next time the code is generated. * +# ***************************************************************************** + +from typing import Dict, Optional, final + +@final +class InstrumentationLibrary: + """ + Information about a library or crate providing instrumentation. + + An instrumentation library should be named to follow any naming conventions + of the instrumented library (e.g. 'middleware' for a web framework). + + See the `instrumentation libraries `_ + spec for more information. + """ + + def __new__( + cls, + name: str, + version: Optional[str] = None, + schema_url: Optional[str] = None, + attributes: Optional[Dict[str, str]] = None, + ) -> "InstrumentationLibrary": + """ + Initializes a new instance of `InstrumentationLibrary`. + + :param name: The name of the instrumentation library. + :param version: The version of the instrumentation library. + :param schema_url: The `schema URL `_ of + the instrumentation library. + :param attributes: The attributes of the instrumentation library. + """ + ... diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.py index a2c6030..a4dbb1c 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.py +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.py @@ -12,7 +12,5 @@ from pyo3_opentelemetry_lib._tracing_subscriber import layers - __doc__ = layers.__doc__ __all__ = getattr(layers, "__all__", []) - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.pyi b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.pyi index 741a427..50d94c1 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.pyi +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/__init__.pyi @@ -11,20 +11,21 @@ # ***************************************************************************** from __future__ import annotations + from typing import TYPE_CHECKING -from . import file as file -from . import otel_otlp_file as otel_otlp_file +from . import file as file from . import otel_otlp as otel_otlp +from . import otel_otlp_file as otel_otlp_file if TYPE_CHECKING: - from typing import Union + from typing import Union - Config = Union[ - file.Config, - otel_otlp_file.Config, - otel_otlp.Config, - ] - """ + Config = Union[ + file.Config, + otel_otlp_file.Config, + otel_otlp.Config, + ] + """ One of the supported layer configurations that may be set on the subscriber configuration. """ diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.py index 365f089..ea3053c 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.py +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.py @@ -12,8 +12,5 @@ from pyo3_opentelemetry_lib._tracing_subscriber.layers import file - __doc__ = file.__doc__ __all__ = getattr(file, "__all__", []) - - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.pyi b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.pyi index 7caa5c2..8054827 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.pyi +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/file/__init__.pyi @@ -39,4 +39,3 @@ class Config: :param json: Whether or not to format the output as JSON. Defaults to `True`. """ ... - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.py index cd94b23..efccc22 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.py +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.py @@ -12,7 +12,5 @@ from pyo3_opentelemetry_lib._tracing_subscriber.layers import otel_otlp - __doc__ = otel_otlp.__doc__ __all__ = getattr(otel_otlp, "__all__", []) - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.pyi b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.pyi index 5dde690..76699c9 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.pyi +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp/__init__.pyi @@ -11,7 +11,10 @@ # ***************************************************************************** from __future__ import annotations -from typing import Dict, Optional, TYPE_CHECKING, final + +from typing import TYPE_CHECKING, Dict, Optional, final + +from pyo3_opentelemetry_lib._tracing_subscriber.common import InstrumentationLibrary @final class SpanLimits: @@ -47,8 +50,6 @@ class Resource: schema_url: Optional[str] = None, ) -> "Resource": ... - - @final class Config: """ @@ -70,6 +71,7 @@ class Config: timeout_millis: Optional[int] = None, pre_shutdown_timeout_millis: Optional[int] = 2000, filter: Optional[str] = None, + instrumentation_library: Optional[InstrumentationLibrary] = None, ) -> "Config": """ Initializes a new `Config`. @@ -94,18 +96,19 @@ class Config: If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported. + :param instrumentation_library: Information about the library providing the tracing instrumentation. """ ... if TYPE_CHECKING: - from typing import List, Union + from typing import List, Union ResourceValueArray = Union[List[bool], List[int], List[float], List[str]] """ An array of `ResourceValue`s. This array is homogenous, so all values must be of the same type. """ - ResourceValue= Union[bool, int, float, str, ResourceValueArray] + ResourceValue = Union[bool, int, float, str, ResourceValueArray] """ A value that can be added to a `Resource`. """ diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.py index db105d0..e28b7c3 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.py +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.py @@ -12,7 +12,5 @@ from pyo3_opentelemetry_lib._tracing_subscriber.layers import otel_otlp_file - __doc__ = otel_otlp_file.__doc__ __all__ = getattr(otel_otlp_file, "__all__", []) - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi index 613126b..bd2b13a 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi @@ -12,6 +12,8 @@ from typing import Optional, final +from pyo3_opentelemetry_lib._tracing_subscriber.common import InstrumentationLibrary + @final class Config: """ @@ -19,7 +21,13 @@ class Config: layer. """ - def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None) -> "Config": + def __new__( + cls, + *, + file_path: Optional[str] = None, + filter: Optional[str] = None, + instrumentation_library: Optional[InstrumentationLibrary] = None, + ) -> "Config": """ :param file_path: The path to the file to write to. If not specified, defaults to stdout. :param filter: A filter string to use for this layer. This uses the same format as the @@ -30,6 +38,6 @@ class Config: If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported. + :param instrumentation_library: Information about the library providing the tracing instrumentation. """ ... - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.py index 5737e29..64d80de 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.py +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.py @@ -12,7 +12,5 @@ from pyo3_opentelemetry_lib._tracing_subscriber import subscriber - __doc__ = subscriber.__doc__ __all__ = getattr(subscriber, "__all__", []) - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.pyi b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.pyi index 548de0c..e0894d0 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.pyi +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/_tracing_subscriber/subscriber/__init__.pyi @@ -22,4 +22,3 @@ class Config: """ def __new__(cls, *, layer: layers.Config) -> "Config": ... - diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/test/__artifacts__/.keep b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/test/__artifacts__/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/test/tracing_test.py b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/test/tracing_test.py index c717545..5e3a93f 100644 --- a/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/test/tracing_test.py +++ b/examples/pyo3-opentelemetry-lib/pyo3_opentelemetry_lib/test/tracing_test.py @@ -44,38 +44,24 @@ def global_tracing(param: Any): return pytest.param(param, marks=pytest.mark.global_tracing_configuration) -@pytest.mark.parametrize( - "config_builder", - [ - lambda filename: CurrentThreadTracingConfig( +_TEST_FILE_EXPORT = [ + lambda filename: CurrentThreadTracingConfig( + export_process=SimpleConfig( + subscriber=subscriber.Config(layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename))) + ) + ), + global_tracing( + lambda filename: GlobalTracingConfig( export_process=SimpleConfig( subscriber=subscriber.Config(layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename))) ) - ), - lambda filename: CurrentThreadTracingConfig( - export_process=BatchConfig( - subscriber=subscriber.Config(layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename))) - ) - ), - global_tracing( - lambda filename: GlobalTracingConfig( - export_process=SimpleConfig( - subscriber=subscriber.Config( - layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename)) - ) - ) - ) - ), - global_tracing( - lambda filename: GlobalTracingConfig( - export_process=BatchConfig( - subscriber=subscriber.Config( - layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename)) - ) - ) - ) - ), - ], + ) + ), +] + + +@pytest.mark.parametrize( + "config_builder", _TEST_FILE_EXPORT, ids=[str(i).zfill(2) for i in range(len(_TEST_FILE_EXPORT))] ) async def test_file_export(config_builder: Callable[[str], TracingConfig], tracer: Tracer, file_export_filter: None): """ @@ -84,20 +70,19 @@ async def test_file_export(config_builder: Callable[[str], TracingConfig], trace await _test_file_export(config_builder, tracer) +_TEST_FILE_EXPORT_MULTI_THREADS = [ + lambda filename: CurrentThreadTracingConfig( + export_process=SimpleConfig( + subscriber=subscriber.Config(layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename))) + ) + ), +] + + @pytest.mark.parametrize( "config_builder", - [ - lambda filename: CurrentThreadTracingConfig( - export_process=SimpleConfig( - subscriber=subscriber.Config(layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename))) - ) - ), - lambda filename: CurrentThreadTracingConfig( - export_process=BatchConfig( - subscriber=subscriber.Config(layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename))) - ) - ), - ], + _TEST_FILE_EXPORT_MULTI_THREADS, + ids=[str(i).zfill(2) for i in range(len(_TEST_FILE_EXPORT_MULTI_THREADS))], ) async def test_file_export_multi_threads( config_builder: Callable[[str], TracingConfig], tracer: Tracer, file_export_filter: None @@ -149,30 +134,21 @@ async def _test_file_export(config_builder: Callable[[str], TracingConfig], trac assert counter["example_function_impl"] == 1 -@pytest.mark.parametrize( - "config_builder", - [ - global_tracing( - lambda filename: GlobalTracingConfig( - export_process=SimpleConfig( - subscriber=subscriber.Config( - layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename)) - ) - ) - ) - ), - global_tracing( - lambda filename: GlobalTracingConfig( - export_process=BatchConfig( - subscriber=subscriber.Config( - layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename)) - ) - ) +_TEST_FILE_EXPORT_ASYNC = [ + global_tracing( + lambda filename: GlobalTracingConfig( + export_process=SimpleConfig( + subscriber=subscriber.Config(layer=file.Config(file_path=os.path.join(_TEST_ARTIFACTS_DIR, filename))) ) - ), - ], + ) + ), +] + + +@pytest.mark.parametrize( + "config_builder", _TEST_FILE_EXPORT_ASYNC, ids=[str(i).zfill(2) for i in range(len(_TEST_FILE_EXPORT_ASYNC))] ) -async def test_file_export_async( +async def test_file_export_asynchronous( config_builder: Callable[[str], TracingConfig], tracer: Tracer, file_export_filter: None ): """ @@ -207,7 +183,7 @@ async def test_file_export_async( span_trace_id = int(span["traceId"], 16) assert span_trace_id is None or span_trace_id == trace_id, filename if span["name"] == "example_function_impl_async": - duration_ns = span["endTimeUnixNano"] - span["startTimeUnixNano"] + duration_ns = int(span["endTimeUnixNano"]) - int(span["startTimeUnixNano"]) expected_duration_ms = 100 assert duration_ns > (expected_duration_ms * 10**6) assert duration_ns < (1.5 * expected_duration_ms * 10**6) @@ -218,18 +194,18 @@ async def test_file_export_async( assert counter["example_function_impl_async"] == 1 +_TEST_OTLP_EXPORT = [ + CurrentThreadTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config()))), + CurrentThreadTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config()))), + global_tracing(GlobalTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config())))), + global_tracing(GlobalTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config())))), +] + + @pytest.mark.parametrize( "config", - [ - CurrentThreadTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config()))), - CurrentThreadTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config()))), - global_tracing( - GlobalTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config()))) - ), - global_tracing( - GlobalTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config()))) - ), - ], + _TEST_OTLP_EXPORT, + ids=[str(i).zfill(2) for i in range(len(_TEST_OTLP_EXPORT))], ) async def test_otlp_export( config: TracingConfig, @@ -267,12 +243,16 @@ async def test_otlp_export( assert counter["example_function_impl"] == 1 +_TEST_OTLP_EXPORT_MULTI_THREADS = [ + CurrentThreadTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config()))), + CurrentThreadTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config()))), +] + + @pytest.mark.parametrize( "config", - [ - CurrentThreadTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config()))), - CurrentThreadTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config()))), - ], + _TEST_OTLP_EXPORT_MULTI_THREADS, + ids=[str(i).zfill(2) for i in range(len(_TEST_OTLP_EXPORT_MULTI_THREADS))], ) async def test_otlp_export_multi_threads( config: TracingConfig, @@ -311,18 +291,18 @@ async def test_otlp_export_multi_threads( assert counter["example_function_impl"] == 1 +TEST_OTLP_EXPORT_ASYNC = [ + global_tracing(GlobalTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config())))), + global_tracing(GlobalTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config())))), +] + + @pytest.mark.parametrize( "config", - [ - global_tracing( - GlobalTracingConfig(export_process=SimpleConfig(subscriber=subscriber.Config(layer=otlp.Config()))) - ), - global_tracing( - GlobalTracingConfig(export_process=BatchConfig(subscriber=subscriber.Config(layer=otlp.Config()))) - ), - ], + TEST_OTLP_EXPORT_ASYNC, + ids=[str(i).zfill(2) for i in range(len(TEST_OTLP_EXPORT_ASYNC))], ) -async def test_otlp_export_async( +async def test_otlp_export_asynchronous( config: TracingConfig, tracer: Tracer, otlp_test_namespace: str, diff --git a/examples/pyo3-opentelemetry-lib/src/lib.rs b/examples/pyo3-opentelemetry-lib/src/lib.rs index 90f4f46..f77a193 100644 --- a/examples/pyo3-opentelemetry-lib/src/lib.rs +++ b/examples/pyo3-opentelemetry-lib/src/lib.rs @@ -37,7 +37,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - pointer_structural_match, private_interfaces, private_bounds, semicolon_in_expressions_from_macros, diff --git a/knope.toml b/knope.toml index 11719fd..60510fa 100644 --- a/knope.toml +++ b/knope.toml @@ -37,6 +37,12 @@ command = "! git diff --cached --quiet" type = "Command" command = "cargo update -w" +# Do not commit the changelog if the version is a release candidate. +[[workflows.steps]] +type = "Command" +command = 'case "$version" in *"-dev."*) git restore --staged --worktree CHANGELOG.md ;; esac || true' +shell = true + [[workflows.steps]] type = "Command" # git diff --cached --quiet exits with 0 if there are *no* staged changes.