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 2a923f6 Add feature sasl for rdkafka (#116)
2a923f6 is described below
commit 2a923f6b26aeb86122b72608abe6eccf4bf6ed7f
Author: jmjoy <[email protected]>
AuthorDate: Fri Jul 5 11:33:09 2024 +0800
Add feature sasl for rdkafka (#116)
---
.github/workflows/pecl.yml | 4 +
.github/workflows/rust.yml | 4 +
Cargo.lock | 177 +++++++++++++++++++++++++++++++++++++++------
Cargo.toml | 3 +-
dist-material/LICENSE | 14 ++++
5 files changed, 179 insertions(+), 23 deletions(-)
diff --git a/.github/workflows/pecl.yml b/.github/workflows/pecl.yml
index 1e29d3e..58dffa2 100644
--- a/.github/workflows/pecl.yml
+++ b/.github/workflows/pecl.yml
@@ -71,6 +71,10 @@ jobs:
if: matrix.os == 'macos-12'
run: brew install protobuf
+ - name: Install libsasl2
+ if: matrix.os == 'ubuntu-20.04'
+ run: sudo apt-get install -y libsasl2-dev
+
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 10a1e66..a66f268 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -111,6 +111,10 @@ jobs:
if: matrix.os == 'macos-12'
run: brew install protobuf
+ - name: Install libsasl2
+ if: matrix.os == 'ubuntu-20.04'
+ run: sudo apt-get install -y libsasl2-dev
+
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
diff --git a/Cargo.lock b/Cargo.lock
index fb1e6dc..5e4ce47 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -77,7 +77,7 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
dependencies = [
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -87,7 +87,7 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188"
dependencies = [
"anstyle",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -499,6 +499,18 @@ dependencies = [
"crypto-common",
]
+[[package]]
+name = "duct"
+version = "0.13.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e4ab5718d1224b63252cd0c6f74f6480f9ffeb117438a2e0f5cf6d9a4798929c"
+dependencies = [
+ "libc",
+ "once_cell",
+ "os_pipe",
+ "shared_child",
+]
+
[[package]]
name = "either"
version = "1.9.0"
@@ -540,7 +552,7 @@ checksum =
"6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f"
dependencies = [
"errno-dragonfly",
"libc",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -959,7 +971,7 @@ checksum =
"b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f"
dependencies = [
"socket2 0.5.3",
"widestring",
- "windows-sys",
+ "windows-sys 0.48.0",
"winreg 0.50.0",
]
@@ -977,7 +989,7 @@ checksum =
"cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
dependencies = [
"hermit-abi",
"rustix",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -1149,7 +1161,7 @@ checksum =
"927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
dependencies = [
"libc",
"wasi",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -1295,6 +1307,16 @@ dependencies = [
"vcpkg",
]
+[[package]]
+name = "os_pipe"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
[[package]]
name = "overload"
version = "0.1.1"
@@ -1321,7 +1343,7 @@ dependencies = [
"libc",
"redox_syscall",
"smallvec",
- "windows-targets",
+ "windows-targets 0.48.1",
]
[[package]]
@@ -1708,7 +1730,9 @@ dependencies = [
"libc",
"libz-sys",
"num_enum",
+ "openssl-sys",
"pkg-config",
+ "sasl2-sys",
]
[[package]]
@@ -1860,7 +1884,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -1875,6 +1899,18 @@ dependencies = [
"webpki",
]
+[[package]]
+name = "rustls-native-certs"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
+dependencies = [
+ "openssl-probe",
+ "rustls-pemfile",
+ "schannel",
+ "security-framework",
+]
+
[[package]]
name = "rustls-pemfile"
version = "1.0.3"
@@ -1905,13 +1941,25 @@ dependencies = [
"winapi-util",
]
+[[package]]
+name = "sasl2-sys"
+version = "0.1.22+2.1.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05f2a7f7efd9fc98b3a9033272df10709f5ee3fa0eabbd61a527a3a1ed6bd3c6"
+dependencies = [
+ "cc",
+ "duct",
+ "libc",
+ "pkg-config",
+]
+
[[package]]
name = "schannel"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88"
dependencies = [
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -2046,6 +2094,16 @@ dependencies = [
"lazy_static",
]
+[[package]]
+name = "shared_child"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
[[package]]
name = "shlex"
version = "1.1.0"
@@ -2113,6 +2171,7 @@ dependencies = [
"phper",
"phper-build",
"prost",
+ "rdkafka",
"reqwest",
"serde_json",
"skywalking",
@@ -2167,7 +2226,7 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877"
dependencies = [
"libc",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -2234,7 +2293,7 @@ dependencies = [
"fastrand",
"redox_syscall",
"rustix",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -2337,7 +2396,7 @@ dependencies = [
"signal-hook-registry",
"socket2 0.4.9",
"tokio-macros",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -2446,6 +2505,7 @@ dependencies = [
"pin-project",
"prost",
"prost-derive",
+ "rustls-native-certs",
"rustls-pemfile",
"tokio",
"tokio-rustls",
@@ -2948,7 +3008,7 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
dependencies = [
- "windows-targets",
+ "windows-targets 0.48.1",
]
[[package]]
@@ -2957,7 +3017,16 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
- "windows-targets",
+ "windows-targets 0.48.1",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.6",
]
[[package]]
@@ -2966,13 +3035,29 @@ version = "0.48.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f"
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",
+ "windows_aarch64_gnullvm 0.48.0",
+ "windows_aarch64_msvc 0.48.0",
+ "windows_i686_gnu 0.48.0",
+ "windows_i686_msvc 0.48.0",
+ "windows_x86_64_gnu 0.48.0",
+ "windows_x86_64_gnullvm 0.48.0",
+ "windows_x86_64_msvc 0.48.0",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
+dependencies = [
+ "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]]
@@ -2981,42 +3066,90 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
+
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
+
[[package]]
name = "windows_i686_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
+[[package]]
+name = "windows_i686_gnu"
+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 = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
+
[[package]]
name = "windows_i686_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
+
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
+
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
+
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
+
[[package]]
name = "winnow"
version = "0.5.3"
@@ -3042,5 +3175,5 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
dependencies = [
"cfg-if",
- "windows-sys",
+ "windows-sys 0.48.0",
]
diff --git a/Cargo.toml b/Cargo.toml
index e649255..3af549e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,7 +36,7 @@ name = "skywalking_agent"
crate-type = ["lib", "cdylib"]
[features]
-kafka-reporter = ["skywalking/kafka-reporter"]
+kafka-reporter = ["skywalking/kafka-reporter", "rdkafka/sasl"]
[dependencies]
anyhow = { version = "1.0.72", features = ["backtrace"] }
@@ -48,6 +48,7 @@ libc = "0.2.147"
once_cell = "1.18.0"
phper = "0.12.0"
prost = "0.11.9"
+rdkafka = { version = "0.32.2", optional = true }
serde_json = { version = "1.0.104", features = ["preserve_order"] }
skywalking = { version = "0.8.0", features = ["management"] }
systemstat = "0.2.3"
diff --git a/dist-material/LICENSE b/dist-material/LICENSE
index 9813e8a..4a27d97 100644
--- a/dist-material/LICENSE
+++ b/dist-material/LICENSE
@@ -221,6 +221,7 @@ The text of each license is the standard Apache 2.0 license.
https://crates.io/crates/prost-build/0.11.9 0.11.9 Apache-2.0
https://crates.io/crates/prost-derive/0.11.9 0.11.9 Apache-2.0
https://crates.io/crates/prost-types/0.11.9 0.11.9 Apache-2.0
+ https://crates.io/crates/sasl2-sys/0.1.22+2.1.28 0.1.22+2.1.28 Apache-2.0
https://crates.io/crates/scripts/0.0.0 0.0.0 Apache-2.0
https://crates.io/crates/skywalking/0.8.0 0.8.0 Apache-2.0
https://crates.io/crates/sync_wrapper/0.1.2 0.1.2 Apache-2.0
@@ -461,14 +462,24 @@ The text of each license is also included in
licenses/LICENSE-[project].txt.
https://crates.io/crates/winapi-x86_64-pc-windows-gnu/0.4.0 0.4.0
Apache-2.0 OR MIT
https://crates.io/crates/windows/0.48.0 0.48.0 Apache-2.0 OR MIT
https://crates.io/crates/windows-sys/0.48.0 0.48.0 Apache-2.0 OR MIT
+ https://crates.io/crates/windows-sys/0.52.0 0.52.0 Apache-2.0 OR MIT
https://crates.io/crates/windows-targets/0.48.1 0.48.1 Apache-2.0 OR MIT
+ https://crates.io/crates/windows-targets/0.52.6 0.52.6 Apache-2.0 OR MIT
https://crates.io/crates/windows_aarch64_gnullvm/0.48.0 0.48.0 Apache-2.0
OR MIT
+ https://crates.io/crates/windows_aarch64_gnullvm/0.52.6 0.52.6 Apache-2.0
OR MIT
https://crates.io/crates/windows_aarch64_msvc/0.48.0 0.48.0 Apache-2.0 OR
MIT
+ https://crates.io/crates/windows_aarch64_msvc/0.52.6 0.52.6 Apache-2.0 OR
MIT
https://crates.io/crates/windows_i686_gnu/0.48.0 0.48.0 Apache-2.0 OR MIT
+ https://crates.io/crates/windows_i686_gnu/0.52.6 0.52.6 Apache-2.0 OR MIT
+ https://crates.io/crates/windows_i686_gnullvm/0.52.6 0.52.6 Apache-2.0 OR
MIT
https://crates.io/crates/windows_i686_msvc/0.48.0 0.48.0 Apache-2.0 OR MIT
+ https://crates.io/crates/windows_i686_msvc/0.52.6 0.52.6 Apache-2.0 OR MIT
https://crates.io/crates/windows_x86_64_gnu/0.48.0 0.48.0 Apache-2.0 OR MIT
+ https://crates.io/crates/windows_x86_64_gnu/0.52.6 0.52.6 Apache-2.0 OR MIT
https://crates.io/crates/windows_x86_64_gnullvm/0.48.0 0.48.0 Apache-2.0
OR MIT
+ https://crates.io/crates/windows_x86_64_gnullvm/0.52.6 0.52.6 Apache-2.0
OR MIT
https://crates.io/crates/windows_x86_64_msvc/0.48.0 0.48.0 Apache-2.0 OR
MIT
+ https://crates.io/crates/windows_x86_64_msvc/0.52.6 0.52.6 Apache-2.0 OR
MIT
========================================================================
Apache-2.0 OR MIT OR Zlib licenses
@@ -523,6 +534,7 @@ The text of each license is also included in
licenses/LICENSE-[project].txt.
https://crates.io/crates/dashmap/5.5.0 5.5.0 MIT
https://crates.io/crates/data-encoding/2.4.0 2.4.0 MIT
https://crates.io/crates/derive_more/0.99.17 0.99.17 MIT
+ https://crates.io/crates/duct/0.13.7 0.13.7 MIT
https://crates.io/crates/errno-dragonfly/0.1.2 0.1.2 MIT
https://crates.io/crates/generic-array/0.14.7 0.14.7 MIT
https://crates.io/crates/globwalk/0.8.1 0.8.1 MIT
@@ -537,6 +549,7 @@ The text of each license is also included in
licenses/LICENSE-[project].txt.
https://crates.io/crates/nom/7.1.3 7.1.3 MIT
https://crates.io/crates/nu-ansi-term/0.46.0 0.46.0 MIT
https://crates.io/crates/openssl-sys/0.9.90 0.9.90 MIT
+ https://crates.io/crates/os_pipe/1.2.0 1.2.0 MIT
https://crates.io/crates/overload/0.1.1 0.1.1 MIT
https://crates.io/crates/parse-zoneinfo/0.3.0 0.3.0 MIT
https://crates.io/crates/phf/0.10.1 0.10.1 MIT
@@ -548,6 +561,7 @@ The text of each license is also included in
licenses/LICENSE-[project].txt.
https://crates.io/crates/redox_syscall/0.3.5 0.3.5 MIT
https://crates.io/crates/schannel/0.1.22 0.1.22 MIT
https://crates.io/crates/sharded-slab/0.1.4 0.1.4 MIT
+ https://crates.io/crates/shared_child/1.0.0 1.0.0 MIT
https://crates.io/crates/slab/0.4.8 0.4.8 MIT
https://crates.io/crates/spin/0.5.2 0.5.2 MIT
https://crates.io/crates/strsim/0.10.0 0.10.0 MIT