feat(sidecar)!: support appsec helper-rust integration with sidecar - #2310
feat(sidecar)!: support appsec helper-rust integration with sidecar#2310cataphract wants to merge 9 commits into
Conversation
Read Cargo's target OS and family in the crashtracker build script instead of build-host cfg values. Build the CXX bridge for its target, keep Unix-only C support and test libraries off Windows, and select the dynamic CRT for Windows targets. Teach the spawn worker trampoline build to distinguish MSVC and GNU Windows environments, skip Unix libraries, and use compatible C++ flags without promoting MinGW warnings to errors. Use lowercase SDK header names and enable the LibraryLoader API for Windows crashtracker tests.
Add an AppSec backend factory that an embedding application can register from a custom sidecar entry point. Start and stop that backend with the sidecar listener, and replace the dynamically loaded helper library and its private socket configuration with a sidecar request/response RPC. Expose the RPC through the blocking client and C FFI. Associate helper client IDs with sidecar connections, notify the backend when connections or sessions close, and reject stale or conflicting IDs after a restart. Send helper-targeted events to the configured AppSec log.
Teach the IPC service macro to generate a serialize-only client request enum when parameters declare alternate #[ClientType] representations. Add blocking channel calls that serialize borrowed request values. Use byte slices for AppSec session IDs and payloads, and retain one request across transport retries. The server still decodes the existing owned request type, avoiding request allocations in FFI and clones on retry.
Format embedded AppSec helper records with a UTC timestamp, level, message, and module. Normalize records bridged from the log crate before filtering helper targets and rendering their module paths. Write helper records to their configured file and exclude other sidecar records from it. Treat "<sidecar log>" as a request to use the main sidecar log without creating a separate helper log layer.
Expose a client factory to the registered AppSec backend so embedded components can enqueue actions into the sidecar telemetry receiver without using FFI. Bind each client to an instance, service, and environment while allowing its application metadata to be rebound. Refresh cached telemetry clients on lookup so active clients are not expired while the in-process path is in use.
Move AppSec lifecycle management into the sidecar server and add a sidecar request that starts the registered backend on demand. Coordinate concurrent initialization and ensure shutdown is owned by one caller. This lets thread-mode listeners receive AppSec configuration after a client connects, while process-mode sidecars still start from daemon configuration.
📚 Documentation Check Results📦
|
Clippy Allow Annotation ReportTracked Clippy
By file and crateBy file
By crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. Panic-inducing macros in particular should be avoided. In the future, this report may become a PR-blocking quality gate. |
🔒 Cargo Deny Results📦
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7112284f0b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
BenchmarksComparisonBenchmark execution time: 2026-08-03 17:22:59 Comparing candidate commit 0d964bb in PR branch Found 9 performance improvements and 14 performance regressions! Performance is the same for 117 metrics, 0 unstable metrics.
|
See DataDog/dd-trace-php#3725
Also fix zigbuild windows builds, for easier testing of windows when running Linux (zigbuild + wine).