feat!: RegexCapability - #2320
Conversation
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: e4b15a1 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksComparisonBenchmark execution time: 2026-08-07 10:15:51 Comparing candidate commit e4b15a1 in PR branch Found 0 performance improvements and 4 performance regressions! Performance is the same for 136 metrics, 0 unstable metrics.
|
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
|
3cdb794 to
e4b15a1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4b15a1e27
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| pub struct Captures { | ||
| pub groups: Vec<Option<Match>>, |
There was a problem hiding this comment.
Preserve capture names for replacement expansion
When this API is used for replacement rules that reference named captures, the caller cannot resolve $name because Captures only exposes positional groups. The existing obfuscation path relies on Replacer::replace_append for capture expansion (libdd-trace-obfuscation/src/replacer.rs:190), so migrating that regex user to this capability would silently lose named-group replacements unless the handle or capture result also exposes capture names.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I'm not sure that's relevant, I'd need to investigate further
What does this PR do?
Add RegexCapability, so that regex in libdatadog can be handled by implementer of another platform.
Motivation
regex was a huge part of the wasm package of libdatadog-nodejs. Forwarding the RegexRequests to the efficient JS' RexExp leads to no Regex in the package, but still lot more efficient than
regex-lite.Additional Notes
How to test the change?