Skip to content

feat: added file capability [APMSP-3780]#2240

Open
Aaalibaba42 wants to merge 2 commits into
mainfrom
jwiriath/file-caps
Open

feat: added file capability [APMSP-3780]#2240
Aaalibaba42 wants to merge 2 commits into
mainfrom
jwiriath/file-caps

Conversation

@Aaalibaba42

Copy link
Copy Markdown
Contributor

What does this PR do?

Added Capability to read, write, and have metadata about files

Motivation

dd-trace-js needing to add info from the /proc in their requests, it's better to have libdatadog drive the call

Additional Notes

Nop

How to test the change?

check, tests, check for wasm32

@Aaalibaba42 Aaalibaba42 requested review from a team as code owners July 15, 2026 09:59
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📚 Documentation Check Results

⚠️ 225 documentation warning(s) found

📦 libdd-capabilities-impl - 199 warning(s)

📦 libdd-capabilities - 26 warning(s)


Updated: 2026-07-15 10:13:39 UTC | Commit: 696a048 | missing-docs job results

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🔒 Cargo Deny Results

⚠️ 1 issue(s) found, showing only errors (advisories, bans, sources)

📦 libdd-capabilities-impl - 1 error(s)

Show output
error[unsound]: Rand is unsound with a custom logger using `rand::rng()`
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:68:1
   │
68 │ rand 0.8.5 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unsound advisory detected
   │
   ├ ID: RUSTSEC-2026-0097
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0097
   ├ It has been reported (by @lopopolo) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:
     
     - The `log` and `thread_rng` features are enabled
     - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined
     - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng`
     - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)
     - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed
     
     `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code to cast `*mut BlockRng<ReseedingCore>` to `&mut BlockRng<ReseedingCore>`. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of [aliased mutable references is Undefined Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.
   ├ Announcement: https://github.com/rust-random/rand/pull/1763
   ├ Solution: Upgrade to >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6 (try `cargo update -p rand`)
   ├ rand v0.8.5
     └── (dev) libdd-common v5.1.0
         └── libdd-capabilities-impl v3.0.0

advisories FAILED, bans ok, sources ok

📦 libdd-capabilities - ✅ No issues


Updated: 2026-07-15 10:15:27 UTC | Commit: 696a048 | dependency-check job results

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Jul 15, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 73.16%
Overall Coverage: 74.45% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d794743 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.88 MB 7.88 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 86.32 MB 86.32 MB -0% (-1.05 KB) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.62 MB 10.62 MB +0% (+120 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 97.54 MB 97.54 MB -0% (-1.21 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
libdatadog-x86-windows
Artifact Baseline Commit Change
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 77.09 MB 77.07 MB --.01% (-11.77 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.83 MB 8.83 MB --.04% (-4.00 KB) 💪
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 92.50 MB 92.50 MB +0% (+6.12 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.74 MB 10.74 MB +0% (+224 B) 👌

@pr-commenter

pr-commenter Bot commented Jul 15, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-07-15 10:43:57

Comparing candidate commit d794743 in PR branch jwiriath/file-caps with baseline commit a10f667 in branch main.

Found 4 performance improvements and 25 performance regressions! Performance is the same for 113 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:otlp/e2e_json/1x1000

  • 🟥 execution_time [+442.161µs; +444.177µs] or [+10.818%; +10.868%]

scenario:otlp/encode_json/1x1000

  • 🟥 execution_time [+433.150µs; +433.762µs] or [+24.351%; +24.386%]

scenario:vec_map/as_deduped_map/needs_dedup_1_in_2/64

  • 🟥 execution_time [+206.368ns; +208.303ns] or [+5.561%; +5.613%]

scenario:vec_map/as_deduped_map/needs_dedup_1_in_4/64

  • 🟥 execution_time [+214.061ns; +215.533ns] or [+6.859%; +6.906%]

scenario:vec_map/contains_key/128

  • 🟥 execution_time [+765.117ns; +771.543ns] or [+5.122%; +5.165%]
  • 🟥 throughput [-420952.138op/s; -417455.188op/s] or [-4.912%; -4.872%]

scenario:vec_map/contains_key/16

  • 🟥 execution_time [+30.980ns; +31.311ns] or [+13.408%; +13.551%]
  • 🟥 throughput [-8271531.112op/s; -8180853.331op/s] or [-11.945%; -11.814%]

scenario:vec_map/contains_key/64

  • 🟥 execution_time [+220.537ns; +228.268ns] or [+5.587%; +5.783%]
  • 🟥 throughput [-885309.460op/s; -857965.677op/s] or [-5.460%; -5.292%]

scenario:vec_map/contains_key/8

  • 🟥 execution_time [+12.462ns; +12.751ns] or [+17.638%; +18.048%]
  • 🟥 throughput [-17325033.506op/s; -16949089.753op/s] or [-15.300%; -14.968%]

scenario:vec_map/get_hit/16

  • 🟩 execution_time [-34.902ns; -34.441ns] or [-14.796%; -14.600%]
  • 🟩 throughput [+11605577.644op/s; +11775429.172op/s] or [+17.110%; +17.360%]

scenario:vec_map/get_hit/8

  • 🟩 execution_time [-6.755ns; -6.678ns] or [-10.421%; -10.302%]
  • 🟩 throughput [+14180547.195op/s; +14354761.999op/s] or [+11.490%; +11.631%]

scenario:vec_map/get_miss/8

  • 🟥 execution_time [+1.816ns; +1.841ns] or [+31.963%; +32.409%]

scenario:vec_map/get_mut/128

  • 🟥 execution_time [+1.917µs; +2.009µs] or [+13.945%; +14.613%]
  • 🟥 throughput [-1192011.657op/s; -1135996.679op/s] or [-12.797%; -12.196%]

scenario:vec_map/get_mut/16

  • 🟥 execution_time [+23.617ns; +33.523ns] or [+8.615%; +12.229%]
  • 🟥 throughput [-6752956.726op/s; -4637900.621op/s] or [-11.460%; -7.870%]

scenario:vec_map/get_mut/64

  • 🟥 execution_time [+414.435ns; +453.188ns] or [+10.661%; +11.658%]
  • 🟥 throughput [-1731018.377op/s; -1579866.485op/s] or [-10.507%; -9.590%]

scenario:vec_map/iter/128

  • 🟥 execution_time [+7.446ns; +7.551ns] or [+7.166%; +7.268%]
  • 🟥 throughput [-83474963.312op/s; -82353492.511op/s] or [-6.776%; -6.685%]

scenario:vec_map/iter/16

  • 🟥 execution_time [+0.590ns; +0.600ns] or [+4.512%; +4.592%]
  • 🟥 throughput [-53750125.825op/s; -52802010.044op/s] or [-4.393%; -4.315%]

scenario:vec_map/iter/8

  • 🟥 execution_time [+0.541ns; +0.547ns] or [+8.080%; +8.171%]
  • 🟥 throughput [-90369196.880op/s; -89303497.117op/s] or [-7.560%; -7.471%]

Benchmark execution time: 2026-07-15 10:59:19

Comparing candidate commit d794743 in PR branch jwiriath/file-caps with baseline commit a10f667 in branch main.

Found 20 performance improvements and 3 performance regressions! Performance is the same for 154 metrics, 10 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:alloc_free/system/4096

  • 🟥 execution_time [+4.835ns; +4.960ns] or [+5.983%; +6.138%]

scenario:credit_card/is_card_number/ 378282246310005

  • 🟩 execution_time [-5.502µs; -5.409µs] or [-7.528%; -7.401%]
  • 🟩 throughput [+1094717.410op/s; +1112248.030op/s] or [+8.001%; +8.129%]

scenario:credit_card/is_card_number/378282246310005

  • 🟩 execution_time [-5.217µs; -5.133µs] or [-7.463%; -7.342%]
  • 🟩 throughput [+1134671.397op/s; +1152140.385op/s] or [+7.932%; +8.054%]

scenario:credit_card/is_card_number/37828224631000521389798

  • 🟩 execution_time [-7.369µs; -7.343µs] or [-14.097%; -14.047%]
  • 🟩 throughput [+3126847.241op/s; +3138990.702op/s] or [+16.345%; +16.409%]

scenario:credit_card/is_card_number/x371413321323331

  • 🟩 execution_time [-337.200ns; -335.075ns] or [-5.581%; -5.546%]
  • 🟩 throughput [+9720961.507op/s; +9783398.073op/s] or [+5.873%; +5.911%]

scenario:credit_card/is_card_number_no_luhn/ 3782-8224-6310-005

  • 🟩 execution_time [-3.753µs; -3.404µs] or [-5.766%; -5.230%]
  • 🟩 throughput [+855133.158op/s; +945888.937op/s] or [+5.565%; +6.156%]

scenario:credit_card/is_card_number_no_luhn/ 378282246310005

  • 🟩 execution_time [-4.773µs; -4.701µs] or [-8.134%; -8.011%]
  • 🟩 throughput [+1485445.390op/s; +1507403.100op/s] or [+8.716%; +8.845%]

scenario:credit_card/is_card_number_no_luhn/378282246310005

  • 🟩 execution_time [-5.158µs; -5.099µs] or [-9.300%; -9.194%]
  • 🟩 throughput [+1827264.614op/s; +1846727.770op/s] or [+10.134%; +10.242%]

scenario:credit_card/is_card_number_no_luhn/37828224631000521389798

  • 🟩 execution_time [-7.360µs; -7.329µs] or [-14.078%; -14.020%]
  • 🟩 throughput [+3119654.614op/s; +3134002.494op/s] or [+16.309%; +16.384%]

scenario:credit_card/is_card_number_no_luhn/x371413321323331

  • 🟩 execution_time [-338.510ns; -336.130ns] or [-5.602%; -5.563%]
  • 🟩 throughput [+9751072.972op/s; +9819640.619op/s] or [+5.892%; +5.933%]

scenario:datadog_sample_span/multiple_rules_last_match/wall_time

  • 🟥 execution_time [+15.770ns; +15.908ns] or [+7.993%; +8.063%]

scenario:receiver_entry_point/report/2644

  • 🟥 execution_time [+162.223µs; +170.110µs] or [+4.444%; +4.660%]

scenario:trace_buffer/4_senders/no_delay

  • 🟩 execution_time [-215.290µs; -186.247µs] or [-8.715%; -7.540%]
  • 🟩 throughput [+121092.047op/s; +141054.833op/s] or [+8.306%; +9.675%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

@Aaalibaba42 Aaalibaba42 changed the title feat: added file capability feat: added file capability [APMSP-3780] Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant