You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/03/14 13:57:16 UTC
[skywalking-php] branch master updated: Upgrade dependencies and adapt the codes. (#57)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-php.git
The following commit(s) were added to refs/heads/master by this push:
new 4d2648f Upgrade dependencies and adapt the codes. (#57)
4d2648f is described below
commit 4d2648ffd7bedac951636442caca1925978b7394
Author: jmjoy <jm...@apache.org>
AuthorDate: Tue Mar 14 21:57:10 2023 +0800
Upgrade dependencies and adapt the codes. (#57)
---
Cargo.lock | 346 +++++++++++++++++++++--------------------
Cargo.toml | 28 ++--
scripts/Cargo.toml | 10 +-
src/plugin/plugin_curl.rs | 19 ++-
src/plugin/plugin_memcached.rs | 33 ++--
src/plugin/plugin_mysqli.rs | 12 +-
src/plugin/plugin_pdo.rs | 21 +--
src/plugin/plugin_predis.rs | 26 ++--
src/plugin/plugin_redis.rs | 67 ++++----
src/request.rs | 13 +-
src/worker.rs | 41 ++---
11 files changed, 307 insertions(+), 309 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 2bbc12e..2f4d69c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -37,9 +37,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.68"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
+checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"
dependencies = [
"backtrace",
]
@@ -84,9 +84,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "axum"
-version = "0.6.2"
+version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1304eab461cf02bd70b083ed8273388f9724c549b316ba3d1e213ce0e9e7fb7e"
+checksum = "13d8068b6ccb8b34db9de397c7043f91db8b4c66414952c6db944f238c4d3db3"
dependencies = [
"async-trait",
"axum-core",
@@ -110,16 +110,15 @@ dependencies = [
"sync_wrapper",
"tokio",
"tower",
- "tower-http",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum-core"
-version = "0.3.1"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f487e40dc9daee24d8a1779df88522f159a54a980f99cfbe43db0be0bd3444a8"
+checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e"
dependencies = [
"async-trait",
"bytes",
@@ -235,9 +234,9 @@ checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70"
[[package]]
name = "cc"
-version = "1.0.78"
+version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
+checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
[[package]]
name = "cexpr"
@@ -256,9 +255,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
-version = "0.4.23"
+version = "0.4.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f"
+checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b"
dependencies = [
"iana-time-zone",
"js-sys",
@@ -271,9 +270,9 @@ dependencies = [
[[package]]
name = "chrono-tz"
-version = "0.6.3"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c39203181991a7dd4343b8005bd804e7a9a37afb8ac070e43771e8c820bbde"
+checksum = "58549f1842da3080ce63002102d5bc954c7bc843d4f47818e642abdc36253552"
dependencies = [
"chrono",
"chrono-tz-build",
@@ -282,9 +281,9 @@ dependencies = [
[[package]]
name = "chrono-tz-build"
-version = "0.0.3"
+version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f509c3a87b33437b05e2458750a0700e5bdd6956176773e6c7d6dd15a283a0c"
+checksum = "db058d493fb2f65f41861bfed7e3fe6335264a9f0f92710cab5bdf01fef09069"
dependencies = [
"parse-zoneinfo",
"phf",
@@ -304,9 +303,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.0.32"
+version = "4.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39"
+checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5"
dependencies = [
"bitflags",
"clap_derive",
@@ -319,9 +318,9 @@ dependencies = [
[[package]]
name = "clap_derive"
-version = "4.0.21"
+version = "4.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014"
+checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0"
dependencies = [
"heck",
"proc-macro-error",
@@ -484,9 +483,9 @@ dependencies = [
[[package]]
name = "either"
-version = "1.8.0"
+version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
+checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]]
name = "encoding_rs"
@@ -597,21 +596,21 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.25"
+version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac"
+checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd"
[[package]]
name = "futures-io"
-version = "0.3.25"
+version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb"
+checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91"
[[package]]
name = "futures-macro"
-version = "0.3.25"
+version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d"
+checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6"
dependencies = [
"proc-macro2",
"quote",
@@ -620,25 +619,28 @@ dependencies = [
[[package]]
name = "futures-sink"
-version = "0.3.25"
+version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9"
+checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2"
[[package]]
name = "futures-task"
-version = "0.3.25"
+version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea"
+checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879"
[[package]]
name = "futures-util"
-version = "0.3.25"
+version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6"
+checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab"
dependencies = [
"futures-core",
+ "futures-io",
"futures-macro",
+ "futures-sink",
"futures-task",
+ "memchr",
"pin-project-lite",
"pin-utils",
"slab",
@@ -728,9 +730,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
@@ -754,9 +756,9 @@ dependencies = [
[[package]]
name = "http"
-version = "0.2.8"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
+checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [
"bytes",
"fnv",
@@ -774,12 +776,6 @@ dependencies = [
"pin-project-lite",
]
-[[package]]
-name = "http-range-header"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29"
-
[[package]]
name = "httparse"
version = "1.8.0"
@@ -794,15 +790,18 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "humansize"
-version = "1.1.1"
+version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026"
+checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7"
+dependencies = [
+ "libm",
+]
[[package]]
name = "hyper"
-version = "0.14.23"
+version = "0.14.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c"
+checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899"
dependencies = [
"bytes",
"futures-channel",
@@ -930,12 +929,12 @@ dependencies = [
[[package]]
name = "io-lifetimes"
-version = "1.0.3"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
+checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
dependencies = [
"libc",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -965,7 +964,7 @@ dependencies = [
"hermit-abi",
"io-lifetimes",
"rustix",
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -1006,9 +1005,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
-version = "0.2.139"
+version = "0.2.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
+checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
[[package]]
name = "libloading"
@@ -1020,6 +1019,12 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "libm"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
+
[[package]]
name = "link-cplusplus"
version = "1.0.8"
@@ -1123,7 +1128,7 @@ dependencies = [
"libc",
"log",
"wasi 0.11.0+wasi-snapshot-preview1",
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -1210,9 +1215,9 @@ dependencies = [
[[package]]
name = "once_cell"
-version = "1.17.0"
+version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
+checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "openssl"
@@ -1291,7 +1296,7 @@ dependencies = [
"libc",
"redox_syscall",
"smallvec",
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -1317,9 +1322,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "pest"
-version = "2.5.2"
+version = "2.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4"
+checksum = "8cbd939b234e95d72bc393d51788aec68aeeb5d51e748ca08ff3aad58cb722f7"
dependencies = [
"thiserror",
"ucd-trie",
@@ -1327,9 +1332,9 @@ dependencies = [
[[package]]
name = "pest_derive"
-version = "2.5.2"
+version = "2.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96504449aa860c8dcde14f9fba5c58dc6658688ca1fe363589d6327b8662c603"
+checksum = "a81186863f3d0a27340815be8f2078dd8050b14cd71913db9fbda795e5f707d7"
dependencies = [
"pest",
"pest_generator",
@@ -1337,9 +1342,9 @@ dependencies = [
[[package]]
name = "pest_generator"
-version = "2.5.2"
+version = "2.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "798e0220d1111ae63d66cb66a5dcb3fc2d986d520b98e49e1852bfdb11d7c5e7"
+checksum = "75a1ef20bf3193c15ac345acb32e26b3dc3223aff4d77ae4fc5359567683796b"
dependencies = [
"pest",
"pest_meta",
@@ -1350,13 +1355,13 @@ dependencies = [
[[package]]
name = "pest_meta"
-version = "2.5.2"
+version = "2.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "984298b75898e30a843e278a9f2452c31e349a073a0ce6fd950a12a74464e065"
+checksum = "5e3b284b1f13a20dc5ebc90aff59a51b8d7137c221131b52a7260c08cbc1cc80"
dependencies = [
"once_cell",
"pest",
- "sha1",
+ "sha2",
]
[[package]]
@@ -1371,18 +1376,18 @@ dependencies = [
[[package]]
name = "phf"
-version = "0.11.1"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c"
+checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
dependencies = [
"phf_shared",
]
[[package]]
name = "phf_codegen"
-version = "0.11.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770"
+checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
dependencies = [
"phf_generator",
"phf_shared",
@@ -1390,9 +1395,9 @@ dependencies = [
[[package]]
name = "phf_generator"
-version = "0.11.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf"
+checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
dependencies = [
"phf_shared",
"rand",
@@ -1400,9 +1405,9 @@ dependencies = [
[[package]]
name = "phf_shared"
-version = "0.11.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676"
+checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
dependencies = [
"siphasher",
"uncased",
@@ -1550,18 +1555,18 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.49"
+version = "1.0.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
+checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
dependencies = [
"unicode-ident",
]
[[package]]
name = "prost"
-version = "0.11.6"
+version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698"
+checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537"
dependencies = [
"bytes",
"prost-derive",
@@ -1591,9 +1596,9 @@ dependencies = [
[[package]]
name = "prost-derive"
-version = "0.11.6"
+version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d"
+checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b"
dependencies = [
"anyhow",
"itertools",
@@ -1683,22 +1688,13 @@ version = "0.6.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
-[[package]]
-name = "remove_dir_all"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
-dependencies = [
- "winapi",
-]
-
[[package]]
name = "reqwest"
-version = "0.11.13"
+version = "0.11.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"
+checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9"
dependencies = [
- "base64 0.13.1",
+ "base64 0.21.0",
"bytes",
"encoding_rs",
"futures-core",
@@ -1727,6 +1723,7 @@ dependencies = [
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
+ "wasm-streams",
"web-sys",
"winreg",
]
@@ -1779,16 +1776,16 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.36.6"
+version = "0.36.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549"
+checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -1839,7 +1836,7 @@ version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
dependencies = [
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -1908,18 +1905,18 @@ checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
[[package]]
name = "serde"
-version = "1.0.152"
+version = "1.0.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
+checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.152"
+version = "1.0.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
+checksum = "d071a94a3fac4aff69d023a7f411e33f40f3483f8c5190b1953822b6b76d7630"
dependencies = [
"proc-macro2",
"quote",
@@ -1928,9 +1925,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.91"
+version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
+checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"
dependencies = [
"indexmap",
"itoa",
@@ -1960,10 +1957,10 @@ dependencies = [
]
[[package]]
-name = "sha1"
-version = "0.10.5"
+name = "sha2"
+version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
+checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -2002,11 +1999,10 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
[[package]]
name = "skywalking"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3af4420143e6b6baef0efad28e7997ea956d25e65e198ac118b18b976ca2cd12"
+checksum = "3df0d94ba57de62d094dc1c00f3b20e1528c66c5b267df7d35da250982e3670b"
dependencies = [
- "async-stream",
"base64 0.13.1",
"bytes",
"cfg-if",
@@ -2014,6 +2010,7 @@ dependencies = [
"futures-util",
"hostname",
"once_cell",
+ "parking_lot",
"portable-atomic",
"prost",
"prost-derive",
@@ -2021,6 +2018,7 @@ dependencies = [
"systemstat",
"thiserror",
"tokio",
+ "tokio-stream",
"tonic",
"tonic-build",
"tracing",
@@ -2104,9 +2102,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
-version = "1.0.107"
+version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
@@ -2121,9 +2119,9 @@ checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8"
[[package]]
name = "systemstat"
-version = "0.2.2"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed5158fd55089515c923306476aaf3fa8ffc29a902561bf0017166a93218831c"
+checksum = "a24aec24a9312c83999a28e3ef9db7e2afd5c64bf47725b758cdc1cafd5b0bd2"
dependencies = [
"bytesize",
"lazy_static",
@@ -2135,23 +2133,22 @@ dependencies = [
[[package]]
name = "tempfile"
-version = "3.3.0"
+version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
+checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95"
dependencies = [
"cfg-if",
"fastrand",
- "libc",
"redox_syscall",
- "remove_dir_all",
- "winapi",
+ "rustix",
+ "windows-sys 0.42.0",
]
[[package]]
name = "tera"
-version = "1.17.1"
+version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3df578c295f9ec044ff1c829daf31bb7581d5b3c2a7a3d87419afe1f2531438c"
+checksum = "27df4164dd125228af4c90c9799a29740e39151767d579f3fc711491054a0378"
dependencies = [
"chrono",
"chrono-tz",
@@ -2166,32 +2163,33 @@ dependencies = [
"serde",
"serde_json",
"slug",
+ "thread_local",
"unic-segment",
]
[[package]]
name = "termcolor"
-version = "1.1.3"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
]
[[package]]
name = "thiserror"
-version = "1.0.38"
+version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
+checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.38"
+version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
+checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e"
dependencies = [
"proc-macro2",
"quote",
@@ -2251,9 +2249,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
-version = "1.24.2"
+version = "1.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb"
+checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64"
dependencies = [
"autocfg",
"bytes",
@@ -2266,7 +2264,7 @@ dependencies = [
"signal-hook-registry",
"socket2",
"tokio-macros",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -2313,9 +2311,9 @@ dependencies = [
[[package]]
name = "tokio-stream"
-version = "0.1.11"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce"
+checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313"
dependencies = [
"futures-core",
"pin-project-lite",
@@ -2403,25 +2401,6 @@ dependencies = [
"tracing",
]
-[[package]]
-name = "tower-http"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858"
-dependencies = [
- "bitflags",
- "bytes",
- "futures-core",
- "futures-util",
- "http",
- "http-body",
- "http-range-header",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
[[package]]
name = "tower-layer"
version = "0.3.2"
@@ -2796,6 +2775,19 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
+[[package]]
+name = "wasm-streams"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078"
+dependencies = [
+ "futures-util",
+ "js-sys",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+]
+
[[package]]
name = "web-sys"
version = "0.3.60"
@@ -2818,9 +2810,9 @@ dependencies = [
[[package]]
name = "which"
-version = "4.3.0"
+version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b"
+checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"
dependencies = [
"either",
"libc",
@@ -2879,47 +2871,71 @@ dependencies = [
"windows_x86_64_msvc",
]
+[[package]]
+name = "windows-sys"
+version = "0.45.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.42.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
+checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
+checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
[[package]]
name = "windows_i686_gnu"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
+checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
[[package]]
name = "windows_i686_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
+checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
+checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
+checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
+checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
[[package]]
name = "winreg"
diff --git a/Cargo.toml b/Cargo.toml
index 3e7a516..60c682f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,28 +36,28 @@ name = "skywalking_agent"
crate-type = ["lib", "cdylib"]
[dependencies]
-anyhow = { version = "1.0.68", features = ["backtrace"] }
+anyhow = { version = "1.0.69", features = ["backtrace"] }
bincode = "1.3.3"
-chrono = "0.4.23"
+chrono = "0.4.24"
dashmap = "5.4.0"
-futures-util = "0.3.25"
+futures-util = "0.3.27"
hostname = "0.3.1"
-libc = "0.2.139"
-once_cell = "1.17.0"
+libc = "0.2.140"
+once_cell = "1.17.1"
phper = "0.10.2"
-prost = "0.11.6"
-serde_json = { version = "1.0.91", features = ["preserve_order"] }
-skywalking = { version = "0.5.0", features = ["management"] }
-systemstat = "0.2.2"
-thiserror = "1.0.38"
-tokio = { version = "1.24.2", features = ["full"] }
-tokio-stream = "0.1.11"
+prost = "0.11.8"
+serde_json = { version = "1.0.94", features = ["preserve_order"] }
+skywalking = { version = "0.6.0", features = ["management"] }
+systemstat = "0.2.3"
+thiserror = "1.0.39"
+tokio = { version = "1.26.0", features = ["full"] }
+tokio-stream = "0.1.12"
tonic = { version = "0.8.3", features = ["tls"] }
tracing = { version = "0.1.37", features = ["attributes"] }
tracing-subscriber = "0.3.16"
url = "2.3.1"
[dev-dependencies]
-axum = "0.6.2"
+axum = "0.6.11"
fastcgi-client = "0.8.0"
-reqwest = { version = "0.11.13", features = ["trust-dns", "json", "stream"] }
+reqwest = { version = "0.11.14", features = ["trust-dns", "json", "stream"] }
diff --git a/scripts/Cargo.toml b/scripts/Cargo.toml
index 689db39..be50f1d 100644
--- a/scripts/Cargo.toml
+++ b/scripts/Cargo.toml
@@ -25,10 +25,10 @@ license = "Apache-2.0"
publish = false
[dependencies]
-anyhow = "1.0.68"
-chrono = "0.4.23"
-clap = { version = "4.0.32", features = ["derive"] }
-serde = { version = "1.0.152", features = ["derive"] }
-tera = "1.17.1"
+anyhow = "1.0.69"
+chrono = "0.4.24"
+clap = { version = "4.1.8", features = ["derive"] }
+serde = { version = "1.0.155", features = ["derive"] }
+tera = "1.18.0"
tracing = "0.1.37"
tracing-subscriber = "0.3.16"
diff --git a/src/plugin/plugin_curl.rs b/src/plugin/plugin_curl.rs
index 61ae88c..2766b99 100644
--- a/src/plugin/plugin_curl.rs
+++ b/src/plugin/plugin_curl.rs
@@ -158,10 +158,10 @@ impl CurlPlugin {
Ok(ctx.create_exit_span(url.path(), peer))
})?;
- span.with_span_object_mut(|span| {
- span.component_id = COMPONENT_PHP_CURL_ID;
- span.add_tag("url", raw_url);
- });
+ let mut span_object = span.span_object_mut();
+ span_object.component_id = COMPONENT_PHP_CURL_ID;
+ span_object.add_tag("url", raw_url);
+ drop(span_object);
let sw_header = RequestContext::try_with_global_ctx(request_id, |ctx| {
Ok(encode_propagation(ctx, url.path(), peer))
@@ -200,14 +200,13 @@ impl CurlPlugin {
.as_z_str()
.context("curl_error is not string")?
.to_str()?;
- span.with_span_object_mut(|span| {
- span.is_error = true;
- span.add_log(vec![("CURL_ERROR", curl_error)]);
- });
+ let mut span_object = span.span_object_mut();
+ span_object.is_error = true;
+ span_object.add_log(vec![("CURL_ERROR", curl_error)]);
} else if http_code >= 400 {
- span.with_span_object_mut(|span| span.is_error = true);
+ span.span_object_mut().is_error = true;
} else {
- span.with_span_object_mut(|span| span.is_error = false);
+ span.span_object_mut().is_error = false;
}
Ok(())
diff --git a/src/plugin/plugin_memcached.rs b/src/plugin/plugin_memcached.rs
index 59371c8..48f4cf6 100644
--- a/src/plugin/plugin_memcached.rs
+++ b/src/plugin/plugin_memcached.rs
@@ -308,9 +308,7 @@ fn after_hook(
let mut span = span.downcast::<Span>().expect("Downcast to Span failed");
if let Some(b) = return_value.as_bool() {
if !b {
- span.with_span_object_mut(|span| {
- span.is_error = true;
- });
+ span.span_object_mut().is_error = true;
let this = get_this_mut(execute_data)?;
let code = this.call(&"getResultCode".to_ascii_lowercase(), [])?;
@@ -343,21 +341,20 @@ fn create_exit_span<'a>(
let mut span =
ctx.create_exit_span(&format!("{}->{}", class_name, function_name), remote_peer);
- span.with_span_object_mut(|obj| {
- obj.set_span_layer(SpanLayer::Cache);
- obj.component_id = COMPONENT_PHP_MEMCACHED_ID;
- obj.add_tag(TAG_CACHE_TYPE, "memcache");
-
- if let Some(cmd) = tag_info.cmd {
- obj.add_tag(TAG_CACHE_CMD, cmd);
- }
- if let Some(op) = &tag_info.op {
- obj.add_tag(TAG_CACHE_OP, op.to_string());
- };
- if let Some(key) = key {
- obj.add_tag(TAG_CACHE_KEY, key)
- }
- });
+ let mut span_object = span.span_object_mut();
+ span_object.set_span_layer(SpanLayer::Cache);
+ span_object.component_id = COMPONENT_PHP_MEMCACHED_ID;
+ span_object.add_tag(TAG_CACHE_TYPE, "memcache");
+ if let Some(cmd) = tag_info.cmd {
+ span_object.add_tag(TAG_CACHE_CMD, cmd);
+ }
+ if let Some(op) = &tag_info.op {
+ span_object.add_tag(TAG_CACHE_OP, op.to_string());
+ };
+ if let Some(key) = key {
+ span_object.add_tag(TAG_CACHE_KEY, key)
+ }
+ drop(span_object);
Ok(span)
})
diff --git a/src/plugin/plugin_mysqli.rs b/src/plugin/plugin_mysqli.rs
index 9be5d8b..b3f1dfc 100644
--- a/src/plugin/plugin_mysqli.rs
+++ b/src/plugin/plugin_mysqli.rs
@@ -132,11 +132,13 @@ fn create_mysqli_exit_span(
&format!("{}->{}", class_name, function_name),
&format!("{}:{}", info.hostname, info.port),
);
- span.with_span_object_mut(|obj| {
- obj.set_span_layer(SpanLayer::Database);
- obj.component_id = COMPONENT_PHP_MYSQLI_ID;
- obj.add_tag("db.type", "mysql");
- });
+
+ let mut span_object = span.span_object_mut();
+ span_object.set_span_layer(SpanLayer::Database);
+ span_object.component_id = COMPONENT_PHP_MYSQLI_ID;
+ span_object.add_tag("db.type", "mysql");
+ drop(span_object);
+
Ok(span)
})
}
diff --git a/src/plugin/plugin_pdo.rs b/src/plugin/plugin_pdo.rs
index 2d98884..7cf1fa9 100644
--- a/src/plugin/plugin_pdo.rs
+++ b/src/plugin/plugin_pdo.rs
@@ -223,10 +223,9 @@ fn after_hook_when_false(this: &mut ZObj, span: &mut Span) -> crate::Result<()>
};
let error = get_error_info_item(info, 2)?.expect_z_str()?.to_str()?;
- span.with_span_object_mut(|span| {
- span.is_error = true;
- span.add_log([("SQLSTATE", state), ("Error Code", code), ("Error", error)]);
- });
+ let mut span_object = span.span_object_mut();
+ span_object.is_error = true;
+ span_object.add_log([("SQLSTATE", state), ("Error Code", code), ("Error", error)]);
Ok(())
}
@@ -252,12 +251,14 @@ fn create_exit_span_with_dsn(
RequestContext::try_with_global_ctx(request_id, |ctx| {
let mut span =
ctx.create_exit_span(&format!("{}->{}", class_name, function_name), &dsn.peer);
- span.with_span_object_mut(|obj| {
- obj.set_span_layer(SpanLayer::Database);
- obj.component_id = COMPONENT_PHP_PDO_ID;
- obj.add_tag(TAG_DB_TYPE, &dsn.db_type);
- obj.add_tag("db.data_source", &dsn.data_source);
- });
+
+ let mut span_object = span.span_object_mut();
+ span_object.set_span_layer(SpanLayer::Database);
+ span_object.component_id = COMPONENT_PHP_PDO_ID;
+ span_object.add_tag(TAG_DB_TYPE, &dsn.db_type);
+ span_object.add_tag("db.data_source", &dsn.data_source);
+ drop(span_object);
+
Ok(span)
})
}
diff --git a/src/plugin/plugin_predis.rs b/src/plugin/plugin_predis.rs
index 9d75b19..1f58197 100644
--- a/src/plugin/plugin_predis.rs
+++ b/src/plugin/plugin_predis.rs
@@ -222,18 +222,18 @@ impl PredisPlugin {
))
})?;
- span.with_span_object_mut(|span| {
- span.set_span_layer(SpanLayer::Cache);
- span.component_id = COMPONENT_PHP_PREDIS_ID;
- span.add_tag(TAG_CACHE_TYPE, "redis");
- span.add_tag(TAG_CACHE_CMD, cmd);
- if let Some(op) = op {
- span.add_tag(TAG_CACHE_OP, op);
- };
- if let Some(key) = key {
- span.add_tag(TAG_CACHE_KEY, key)
- }
- });
+ let mut span_object = span.span_object_mut();
+ span_object.set_span_layer(SpanLayer::Cache);
+ span_object.component_id = COMPONENT_PHP_PREDIS_ID;
+ span_object.add_tag(TAG_CACHE_TYPE, "redis");
+ span_object.add_tag(TAG_CACHE_CMD, cmd);
+ if let Some(op) = op {
+ span_object.add_tag(TAG_CACHE_OP, op);
+ };
+ if let Some(key) = key {
+ span_object.add_tag(TAG_CACHE_KEY, key)
+ }
+ drop(span_object);
Ok(Box::new(span))
}),
@@ -242,7 +242,7 @@ impl PredisPlugin {
let typ = return_value.get_type_info();
if typ.is_null() || typ.is_false() {
- span.with_span_object_mut(|span| span.is_error = true);
+ span.span_object_mut().is_error = true;
}
Ok(())
diff --git a/src/plugin/plugin_redis.rs b/src/plugin/plugin_redis.rs
index 67a4fa6..ffa5b28 100644
--- a/src/plugin/plugin_redis.rs
+++ b/src/plugin/plugin_redis.rs
@@ -260,11 +260,11 @@ impl RedisPlugin {
Ok(ctx.create_exit_span(&format!("{}->{}", class_name, function_name), &addr))
})?;
- span.with_span_object_mut(|span| {
- span.set_span_layer(SpanLayer::Cache);
- span.component_id = COMPONENT_PHP_REDIS_ID;
- span.add_tag(TAG_CACHE_TYPE, "redis");
- });
+ let mut span_object = span.span_object_mut();
+ span_object.set_span_layer(SpanLayer::Cache);
+ span_object.component_id = COMPONENT_PHP_REDIS_ID;
+ span_object.add_tag(TAG_CACHE_TYPE, "redis");
+ drop(span_object);
Ok(Box::new(span))
}),
@@ -306,21 +306,21 @@ impl RedisPlugin {
Ok(ctx.create_exit_span(&format!("{}->{}", class_name, function_name), &peer))
})?;
- span.with_span_object_mut(|span| {
- span.set_span_layer(SpanLayer::Cache);
- span.component_id = COMPONENT_PHP_REDIS_ID;
- span.add_tag(TAG_CACHE_TYPE, "redis");
- span.add_tag(
- TAG_CACHE_CMD,
- *REDIS_ALL_MAPPING.get(function_name_key).unwrap(),
- );
- if let Some(op) = op {
- span.add_tag(TAG_CACHE_OP, op);
- }
- if let Some(key) = key {
- span.add_tag(TAG_CACHE_KEY, key)
- }
- });
+ let mut span_object = span.span_object_mut();
+ span_object.set_span_layer(SpanLayer::Cache);
+ span_object.component_id = COMPONENT_PHP_REDIS_ID;
+ span_object.add_tag(TAG_CACHE_TYPE, "redis");
+ span_object.add_tag(
+ TAG_CACHE_CMD,
+ *REDIS_ALL_MAPPING.get(function_name_key).unwrap(),
+ );
+ if let Some(op) = op {
+ span_object.add_tag(TAG_CACHE_OP, op);
+ }
+ if let Some(key) = key {
+ span_object.add_tag(TAG_CACHE_KEY, key)
+ }
+ drop(span_object);
Ok(Box::new(span))
}),
@@ -362,22 +362,21 @@ fn after_hook(
let ex = unsafe { ZObj::try_from_mut_ptr(eg!(exception)) };
if let Some(ex) = ex {
- span.with_span_object_mut(|span| {
- span.is_error = true;
+ let mut span_object = span.span_object_mut();
+ span_object.is_error = true;
- let mut logs = Vec::new();
- if let Ok(class_name) = ex.get_class().get_name().to_str() {
- logs.push(("Exception Class", class_name.to_owned()));
- }
- if let Some(message) = ex.get_property("message").as_z_str() {
- if let Ok(message) = message.to_str() {
- logs.push(("Exception Message", message.to_owned()));
- }
- }
- if !logs.is_empty() {
- span.add_log(logs);
+ let mut logs = Vec::new();
+ if let Ok(class_name) = ex.get_class().get_name().to_str() {
+ logs.push(("Exception Class", class_name.to_owned()));
+ }
+ if let Some(message) = ex.get_property("message").as_z_str() {
+ if let Ok(message) = message.to_str() {
+ logs.push(("Exception Message", message.to_owned()));
}
- });
+ }
+ if !logs.is_empty() {
+ span_object.add_log(logs);
+ }
}
Ok(())
diff --git a/src/request.rs b/src/request.rs
index d3cc7e7..f7231fe 100644
--- a/src/request.rs
+++ b/src/request.rs
@@ -252,11 +252,12 @@ fn create_request_context(
Some(propagation) => ctx.create_entry_span_with_propagation(&operation_name, &propagation),
None => ctx.create_entry_span(&operation_name),
};
- span.with_span_object_mut(|span| {
- span.component_id = COMPONENT_PHP_ID;
- span.add_tag("url", uri);
- span.add_tag("http.method", method);
- });
+
+ let mut span_object = span.span_object_mut();
+ span_object.component_id = COMPONENT_PHP_ID;
+ span_object.add_tag("url", uri);
+ span_object.add_tag("http.method", method);
+ drop(span_object);
RequestContext::set_global(
request_id,
@@ -277,7 +278,7 @@ fn finish_request_context(request_id: Option<i64>, status_code: i32) -> crate::R
entry_span.add_tag("http.status_code", &status_code.to_string());
if status_code >= 400 {
- entry_span.with_span_object_mut(|span| span.is_error = true);
+ entry_span.span_object_mut().is_error = true;
}
drop(entry_span);
diff --git a/src/worker.rs b/src/worker.rs
index 8b98104..19210db 100644
--- a/src/worker.rs
+++ b/src/worker.rs
@@ -35,7 +35,7 @@ use skywalking::{
};
use std::{
cmp::Ordering, error::Error, ffi::CStr, fs, io, marker::PhantomData, num::NonZeroUsize,
- process::exit, sync::Arc, thread::available_parallelism, time::Duration,
+ process::exit, thread::available_parallelism, time::Duration,
};
use tokio::{
net::UnixListener,
@@ -43,7 +43,7 @@ use tokio::{
select,
signal::unix::{signal, SignalKind},
sync::mpsc::{self, error::TrySendError},
- time::{self, sleep},
+ time::sleep,
};
use tonic::{
async_trait,
@@ -186,8 +186,8 @@ async fn start_worker(server_addr: String) -> anyhow::Result<()> {
let handle = reporter
.reporting()
.await
- .with_status_handle(|status| {
- warn!(?status, "Collect failed");
+ .with_status_handle(|message, status| {
+ warn!(?status, "Collect failed: {}", message);
})
.spawn();
@@ -299,24 +299,10 @@ impl Drop for WorkerExitGuard {
}
fn report_properties_and_keep_alive(reporter: TxReporter) {
- let manager = Arc::new(Manager::new(&*SERVICE_NAME, &*SERVICE_INSTANCE, reporter));
- let manager_ = manager.clone();
-
- // TODO Refactor report instance properties and keep alive like skywalking-java.
- //
- // In skywalking-java, when properties_report_period reached, report the
- // instance properties without keep alive. However, this needs to change the
- // api of skywalking-rust, so wait for the next version of skywalking-rust.
- tokio::spawn(async move {
- let period = *HEARTBEAT_PERIOD * *PROPERTIES_REPORT_PERIOD_FACTOR;
- if period <= 0 {
- return;
- }
-
- let mut ticker = time::interval(Duration::from_secs(period as u64));
- loop {
- ticker.tick().await;
+ let manager = Manager::new(&*SERVICE_NAME, &*SERVICE_INSTANCE, reporter);
+ manager.report_and_keep_alive(
+ || {
let mut props = Properties::new();
props.insert_os_info();
props.update(Properties::KEY_LANGUAGE, "php");
@@ -324,12 +310,9 @@ fn report_properties_and_keep_alive(reporter: TxReporter) {
libc::getppid().to_string()
});
debug!(?props, "Report instance properties");
-
- manager_.report_properties(props);
- }
- });
-
- if *HEARTBEAT_PERIOD <= 0 {
- manager.keep_alive(Duration::from_secs(*HEARTBEAT_PERIOD as u64));
- }
+ props
+ },
+ Duration::from_secs(*HEARTBEAT_PERIOD as u64),
+ *PROPERTIES_REPORT_PERIOD_FACTOR as usize,
+ );
}