Skip to content

chore: add and agents.md#1956

Merged
paullegranddc merged 6 commits into
mainfrom
paullgdc/add_agents_md
May 27, 2026
Merged

chore: add and agents.md#1956
paullegranddc merged 6 commits into
mainfrom
paullgdc/add_agents_md

Conversation

@paullegranddc
Copy link
Copy Markdown
Contributor

What does this PR do?

Add an AGENTS.md file

It is more or less structured like the datadog-agent repo agents.md which I found to work well

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e583d45526

ℹ️ 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".

Comment thread AGENTS.md
# Hyper backend
cargo nextest run -p libdd-http-client --no-default-features --features hyper-backend,https
```
- **test_spawn_from_lib**: `cargo nextest run --package test_spawn_from_lib --features prefer-dynamic`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add RUSTFLAGS to the spawn-from-lib test command

For test_spawn_from_lib on Unix/Linux, enabling the prefer-dynamic Cargo feature is not enough: the crate's own Cargo.toml notes these tests require prefer-dynamic, and the CI step in .github/workflows/test.yml sets RUSTFLAGS="-C prefer-dynamic" when running this package. Agents following this documented command will run a different validation path from CI and can get misleading failures when the trampoline test binary is not built dynamically.

Useful? React with 👍 / 👎.

@paullegranddc paullegranddc requested a review from a team as a code owner May 7, 2026 13:07
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.80%. Comparing base (cfd7cd5) to head (beaa018).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1956      +/-   ##
==========================================
- Coverage   72.83%   72.80%   -0.03%     
==========================================
  Files         459      459              
  Lines       76134    76134              
==========================================
- Hits        55455    55433      -22     
- Misses      20679    20701      +22     
Components Coverage Δ
libdd-crashtracker 65.22% <ø> (ø)
libdd-crashtracker-ffi 36.82% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 85.60% <ø> (ø)
libdd-data-pipeline-ffi 75.70% <ø> (ø)
libdd-common 79.89% <ø> (ø)
libdd-common-ffi 74.41% <ø> (ø)
libdd-telemetry 73.34% <ø> (ø)
libdd-telemetry-ffi 31.36% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 74.75% <ø> (-1.47%) ⬇️
libdd-profiling 81.69% <ø> (-0.02%) ⬇️
libdd-profiling-ffi 64.79% <ø> (ø)
libdd-sampling 97.46% <ø> (ø)
datadog-sidecar 29.19% <ø> (ø)
datdog-sidecar-ffi 10.17% <ø> (ø)
spawn-worker 48.86% <ø> (ø)
libdd-tinybytes 93.80% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.30% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 88.83% <ø> (ø)
libdd-tracer-flare 86.88% <ø> (ø)
libdd-log 74.83% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-datadog-prod-us1
Copy link
Copy Markdown
Contributor

datadog-datadog-prod-us1 Bot commented May 7, 2026

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 72.81% (-0.03%)

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

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 7, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 82.94 MB 82.94 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.63 MB 7.63 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.02 MB 94.02 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.25 MB 10.25 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.54 MB 24.54 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 83.96 KB 83.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 178.23 MB 178.24 MB +0% (+8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 915.25 MB 915.25 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.03 MB 8.03 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 83.96 KB 83.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.77 MB 23.77 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 47.43 MB 47.43 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.27 MB 21.27 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 85.29 KB 85.29 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 182.23 MB 182.24 MB +0% (+8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 908.37 MB 908.37 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.20 MB 6.20 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 85.29 KB 85.29 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 25.48 MB 25.48 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 45.07 MB 45.07 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 73.95 MB 73.95 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.52 MB 8.52 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 89.36 MB 89.36 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.36 MB 10.36 MB 0% (0 B) 👌

Comment thread AGENTS.md
### Licenses
All source files must have Apache 2.0 license headers (except `symbolizer-ffi`). The third-party license CSV (`LICENSE-3rdparty.csv`) is validated in CI. To regenerate:
```bash
./scripts/update_license_3rdparty.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably would work better as pre-commit hook :)

Comment thread AGENTS.md
Comment on lines +127 to +128
- Avoid `unwrap`/`panic!` outside of tests; bubble errors up instead.
- Bubble errors up to the library caller with detail — prefer structured error enums (e.g. `thiserror`) over opaque strings.
Copy link
Copy Markdown
Contributor

@pawelchcki pawelchcki May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L127-128 should probably could be merged together

Comment thread AGENTS.md Outdated
Comment on lines +9 to +13
- **Rust**: MSRV `1.84.1` (set in workspace `Cargo.toml`); use stable for build/clippy.
- **Nightly rustfmt**: `nightly-2026-02-08` — `rustfmt.toml` uses nightly-only features.
- **cargo-nextest**: `0.9.96` (required for running tests). Install with `cargo install --locked 'cargo-nextest@0.9.96'`.
- **cbindgen**: `0.29` (for FFI header generation).
- **System tools**: `cmake` and `protoc`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should all probably get inferred from metadada

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, otherwise this is going to be drifting hard. Also, for most of them the version isn't that relevant (e.g. cargo nextest), though it is for some others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment thread AGENTS.md
cargo check -p <crate> # fast iteration on a single crate
cargo build --workspace --exclude builder # full build
```
2. **Format and lint** — always run on every crate that was touched, before finishing:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another plug for pre-commit hook :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a bad think if some instructions are both in the pre-commit hook and AGENT.md given that not everyone will enable pre-commit hooks, for example it might not work properly out of the box for some people or some might find them too slow (ie me when touching one line in datadog-agent and it taking 10mins to run 🥲 )

Comment thread AGENTS.md
```bash
cargo ffi-test
```
5. **If `tracing_integration_tests::` tests fail**, they require Docker. Prompt the user to start Docker and retry; to skip them locally use:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great example of filling the knowledge cracks which is not easly deduced

Comment thread AGENTS.md Outdated
- **libdd-shared-runtime** / **libdd-shared-runtime-ffi** — shared Tokio runtime with fork-safe worker management
- **libdd-capabilities** / **libdd-capabilities-impl** — portable capability traits and native implementations for cross-platform libdatadog
- **libdd-http-client** — HTTP client abstraction with `reqwest-backend` (default) and `hyper-backend` features
- **libdd-dogstatsd-client** — DogStatsD metrics client
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will infer this information, overall I suspect most of this section is redundant, but I haven't used this AGENTS.md yet, so I'm not 100% sure

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I'm not sure it's useful/worth the trouble putting this here. Domain-specific knowledge or datadog-specific constraints that can't be easily inferred, like the test section above, seems to be more valuable and less inclined to drift.

Comment thread AGENTS.md Outdated
Comment on lines +9 to +13
- **Rust**: MSRV `1.84.1` (set in workspace `Cargo.toml`); use stable for build/clippy.
- **Nightly rustfmt**: `nightly-2026-02-08` — `rustfmt.toml` uses nightly-only features.
- **cargo-nextest**: `0.9.96` (required for running tests). Install with `cargo install --locked 'cargo-nextest@0.9.96'`.
- **cbindgen**: `0.29` (for FFI header generation).
- **System tools**: `cmake` and `protoc`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, otherwise this is going to be drifting hard. Also, for most of them the version isn't that relevant (e.g. cargo nextest), though it is for some others.

Comment thread AGENTS.md Outdated
2. **Format and lint** — always run on every crate that was touched, before finishing:
```bash
cargo +nightly-2026-02-08 fmt --all -- --check
cargo +stable clippy --workspace --all-targets --all-features -- -D warnings -A clippy::manual_is_multiple_of
Copy link
Copy Markdown
Contributor

@yannham yannham May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this accept coming from? If there's some config clippy file, better link to it rather than hardcoding allowlisted lints.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the CI. The reason for it is that satisfying this lint requires rust 1.85, which is over the MSRV.
I could add a lint skip, with a comment to remove it when we update the MSRV

Comment thread AGENTS.md Outdated
- **libdd-shared-runtime** / **libdd-shared-runtime-ffi** — shared Tokio runtime with fork-safe worker management
- **libdd-capabilities** / **libdd-capabilities-impl** — portable capability traits and native implementations for cross-platform libdatadog
- **libdd-http-client** — HTTP client abstraction with `reqwest-backend` (default) and `hyper-backend` features
- **libdd-dogstatsd-client** — DogStatsD metrics client
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I'm not sure it's useful/worth the trouble putting this here. Domain-specific knowledge or datadog-specific constraints that can't be easily inferred, like the test section above, seems to be more valuable and less inclined to drift.

Comment thread AGENTS.md
- Avoid `unwrap`/`panic!` outside of tests; bubble errors up instead.
- Bubble errors up to the library caller with detail — prefer structured error enums (e.g. `thiserror`) over opaque strings.
- Stay free of global effects unless a feature requires them: no spawning threads, no globals, no reading environment variables behind the caller's back.
- Care about performance, especially memory allocations on hot paths.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add something about being extra-careful regarding UB, given FFI and/or unsafe code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a section about FFI

Comment thread AGENTS.md Outdated
- Care about performance, especially memory allocations on hot paths.

### Cryptography
- Non-FIPS builds: ring as TLS crypto provider
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about AI, but as a human who comes to this codebase, I would find this section inscrutable because acronyms aren't explained. Maybe should we quickly explain (one sentence) what FIPS is and why someone working on libdatadog should care?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up this comment

Comment thread AGENTS.md Outdated
Comment on lines +148 to +151
### Release profiles
- `dev`: full debug info
- `release`: size-optimized (`opt-level = "s"`), LTO, single codegen unit
- `bench`: `opt-level = 3`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is readable from the (rather small) Cargo.toml and subject to drift. Not sure it's worth repeating here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted

Comment thread AGENTS.md Outdated
```
- **test_spawn_from_lib**: `cargo nextest run --package test_spawn_from_lib --features prefer-dynamic`.

## Architecture
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lately we've been adding , removing and splitting crates. Therefore I guess this section will become outdated in no time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the crates section. We can add it back latter if it seems useful

@paullegranddc
Copy link
Copy Markdown
Contributor Author

I removed the sections that are the most likely to drift, we can add them back latter if needed

Comment thread AGENTS.md Outdated
- Care about performance, especially memory allocations on hot paths.

### Cryptography
- Non-FIPS builds: ring as TLS crypto provider
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up this comment

Comment thread AGENTS.md Outdated
- Windows FIPS requires env var: `AWS_LC_FIPS_SYS_NO_ASM=1`

### Commit Messages
PR titles and commits must follow **Conventional Commits**: `<type>[scope]: <description>`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? Not sure it's the right way to write it. Maybe an example would work better, but to indicate there are parentheses.

Suggested change
PR titles and commits must follow **Conventional Commits**: `<type>[scope]: <description>`
PR titles and commits must follow **Conventional Commits**: `<type>([scope]): <description>`

@paullegranddc
Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented May 27, 2026

View all feedbacks in Devflow UI.

2026-05-27 10:02:43 UTC ℹ️ Start processing command /merge


2026-05-27 10:02:51 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-05-27 10:42:16 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 49m (p90).


2026-05-27 10:52:26 UTC ℹ️ MergeQueue: This merge request was already merged

This pull request was merged directly.

@paullegranddc paullegranddc merged commit af9b62b into main May 27, 2026
49 checks passed
@paullegranddc paullegranddc deleted the paullgdc/add_agents_md branch May 27, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants