Skip to content

Conversation

@lucaspimentel
Copy link
Member

@lucaspimentel lucaspimentel commented Oct 2, 2025

Summary of changes

  • Add performance optimization patterns, testing guidelines, and logging guidelines to AGENTS.md.
  • Add Azure Functions automatic instrumentation setup documentation.
  • Add glossary section for common acronyms.
  • Bonus: Fix noop pipeline path exclusions to properly skip CI for documentation-only PRs.

Reason for change

Documentation: Document reusable patterns that apply broadly across the tracer codebase:

CI Optimization: The noop pipeline was not triggering for documentation-only PRs because it uses StartsWith() matching, not glob patterns. The **/CLAUDE.md pattern never matched .claude/CLAUDE.md.

Implementation details

New documentation sections:

  • Performance Guidelines: Identifies performance-critical code paths (bootstrap/startup and hot paths)
  • Performance Optimization Patterns: Zero-allocation structs, logging best practices, avoiding params arrays
  • Testing Patterns: Abstraction-for-testability with examples
  • Logging Guidelines: Consistent customer-facing terminology (Datadog SDK, Instrumentation, Continuous Profiler, Datadog.Trace.dll)
  • Azure Functions:
    • Setup instructions for Site Extension vs NuGet package
    • Environment variables for Windows and Linux
    • Developer references to docs/development/AzureFunctions.md
    • Testing instructions and sample locations
    • Dependency information about Datadog.Serverless.Compat and agent startup mechanisms
  • Glossary: Common acronyms (AAS, APM, ASM, CI, DBM, DSM, IAST, OTEL, RCM, RASP, WAF)

Pipeline fixes:

  • Changed **/CLAUDE.md glob to .claude/ prefix (compatible with StartsWith())
  • Added .devcontainer/, .vscode/, LICENSE, NOTICE to exclusions

Other changes:

  • Fixed .claude/CLAUDE.md relative path reference
  • Improved formatting in Coding Style section

Test coverage

N/A - documentation and CI configuration only

@lucaspimentel lucaspimentel changed the title small updates to AGENTS.md Add performance and testing guidelines to AGENTS.md Oct 2, 2025
@lucaspimentel lucaspimentel marked this pull request as ready for review October 2, 2025 19:19
@lucaspimentel lucaspimentel requested a review from a team as a code owner October 2, 2025 19:19
@lucaspimentel lucaspimentel changed the title Add performance and testing guidelines to AGENTS.md Add (basic) performance and testing guidelines to AGENTS.md Oct 2, 2025
@lucaspimentel lucaspimentel changed the title Add (basic) performance and testing guidelines to AGENTS.md Add performance and testing guidelines to AGENTS.md Oct 2, 2025
Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Did you write these or did AI write these?

Also curious, was this testable somehow to see whether or not the changes here improved the output that the model gives?

Not really blockers just me wondering how these work 😅

@lucaspimentel
Copy link
Member Author

lucaspimentel commented Oct 2, 2025

Did you write these or did AI write these?

Good question. I had Claude Code (the cli tool) write them based on work across several sessions. I asked it to keep track of all the changes we were making and why into a file, especially if it generated code and I asked for specific changes, like "do it again but change XYZ to avoid heap allocations." Later I asked it to summarize that into guidelines and add them to AGENTS.md.

Also curious, was this testable somehow to see whether or not the changes here improved the output that the model gives?

I did #7602 yesterday and I also I did more coding work after adding the guidelines in this PR locally, and it does help. For example, when reviewing my changes to the managed loader it is focusing more on performance than it did before. When generating code it is following the new C# syntax suggestion. Also after #7602 is now using our PR template to update my PR descriptions (it generating the description for this PR).

Not really blockers just me wondering how these work 😅

No, I get it. It's all new. So far I only used AI for auto-complete in the IDE, but I started playing with agents recently and I think I'm finally "getting" it. I've enjoyed having Claude Code in a terminal while I work. It's more like pair programming. I write some code and ask AI to review it, or I ask it to generate some code and I review that. It goes both ways 😝

@lucaspimentel lucaspimentel changed the title Add performance and testing guidelines to AGENTS.md Add performance, testing, and logging guidelines to AGENTS.md Oct 2, 2025
@lucaspimentel lucaspimentel changed the title Add performance, testing, and logging guidelines to AGENTS.md Add performance, testing, and logging guidelines to AGENTS.md Oct 2, 2025
@lucaspimentel lucaspimentel force-pushed the lpimentel/update-agents-doc branch from c72a65d to d2634eb Compare October 2, 2025 21:56
@datadog-official

This comment has been minimized.

@lucaspimentel lucaspimentel enabled auto-merge (squash) October 3, 2025 14:25
@lucaspimentel lucaspimentel changed the title Add performance, testing, and logging guidelines to AGENTS.md Add performance, testing, logging, Azure Functions, and glossary to AGENTS.md Oct 3, 2025
@lucaspimentel lucaspimentel changed the title Add performance, testing, logging, Azure Functions, and glossary to AGENTS.md Add performance, testing, logging, Azure Functions, and glossary to AGENTS.md Oct 3, 2025
lucaspimentel and others added 11 commits October 3, 2025 11:36
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The noop pipeline's path detection uses simple `StartsWith()` matching, not glob patterns. Changed `**/CLAUDE.md` to `.claude/` prefix and added other dev/docs paths that should skip CI.

Added exclusions:
- `.claude/` (instead of `**/CLAUDE.md` glob)
- `.devcontainer/` (dev container config)
- `.vscode/` (IDE settings)
- `LICENSE`, `NOTICE` (license files)

This ensures PRs that only modify documentation or dev settings trigger the noop pipeline instead of the full CI build.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Changed from "Read @../AGENTS.md for more details on this repository."
to "See @../AGENTS.md" for brevity while maintaining clarity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@lucaspimentel lucaspimentel force-pushed the lpimentel/update-agents-doc branch from df7f22b to e7d1e19 Compare October 3, 2025 15:36
- Add Development & Testing subsection with reference to docs/development/AzureFunctions.md
- Document Datadog.Serverless.Compat dependency and agent startup mechanisms
- Add Glossary section with common acronyms (AAS, APM, ASM, CI, DBM, DSM, IAST, OTEL, RCM, RASP, WAF)
@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (80ms)  : 75, 84
     .   : milestone, 80,
    master - mean (80ms)  : 77, 84
     .   : milestone, 80,

    section Baseline
    This PR (7609) - mean (75ms)  : 71, 79
     .   : milestone, 75,
    master - mean (75ms)  : 71, 79
     .   : milestone, 75,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (1,110ms)  : 1048, 1172
     .   : milestone, 1110,
    master - mean (1,122ms)  : 1058, 1186
     .   : milestone, 1122,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (119ms)  : 114, 125
     .   : milestone, 119,
    master - mean (120ms)  : 114, 125
     .   : milestone, 120,

    section Baseline
    This PR (7609) - mean (118ms)  : 114, 123
     .   : milestone, 118,
    master - mean (119ms)  : 115, 123
     .   : milestone, 119,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (792ms)  : 766, 818
     .   : milestone, 792,
    master - mean (802ms)  : 782, 821
     .   : milestone, 802,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (112ms)  : 108, 117
     .   : milestone, 112,
    master - mean (114ms)  : 109, 119
     .   : milestone, 114,

    section Baseline
    This PR (7609) - mean (111ms)  : 106, 117
     .   : milestone, 111,
    master - mean (113ms)  : 107, 118
     .   : milestone, 113,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (829ms)  : 772, 886
     .   : milestone, 829,
    master - mean (838ms)  : 778, 898
     .   : milestone, 838,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (104ms)  : 99, 109
     .   : milestone, 104,
    master - mean (104ms)  : 99, 109
     .   : milestone, 104,

    section Baseline
    This PR (7609) - mean (103ms)  : 98, 108
     .   : milestone, 103,
    master - mean (103ms)  : 98, 108
     .   : milestone, 103,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (708ms)  : 687, 730
     .   : milestone, 708,
    master - mean (722ms)  : 698, 745
     .   : milestone, 722,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (201ms)  : 198, 204
     .   : milestone, 201,
    master - mean (202ms)  : 198, 207
     .   : milestone, 202,

    section Baseline
    This PR (7609) - mean (199ms)  : 194, 204
     .   : milestone, 199,
    master - mean (200ms)  : 193, 206
     .   : milestone, 200,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (1,186ms)  : 1119, 1252
     .   : milestone, 1186,
    master - mean (1,213ms)  : 1145, 1282
     .   : milestone, 1213,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (286ms)  : 280, 292
     .   : milestone, 286,
    master - mean (296ms)  : 284, 308
     .   : milestone, 296,

    section Baseline
    This PR (7609) - mean (284ms)  : 278, 290
     .   : milestone, 284,
    master - mean (288ms)  : 281, 295
     .   : milestone, 288,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (954ms)  : 911, 997
     .   : milestone, 954,
    master - mean (981ms)  : 938, 1024
     .   : milestone, 981,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (288ms)  : 284, 292
     .   : milestone, 288,
    master - mean (299ms)  : 288, 310
     .   : milestone, 299,

    section Baseline
    This PR (7609) - mean (291ms)  : 281, 302
     .   : milestone, 291,
    master - mean (301ms)  : 288, 314
     .   : milestone, 301,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (1,016ms)  : 975, 1057
     .   : milestone, 1016,
    master - mean (1,053ms)  : 993, 1114
     .   : milestone, 1053,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7609) - mean (278ms)  : 273, 284
     .   : milestone, 278,
    master - mean (295ms)  : 285, 304
     .   : milestone, 295,

    section Baseline
    This PR (7609) - mean (281ms)  : 271, 290
     .   : milestone, 281,
    master - mean (291ms)  : 284, 299
     .   : milestone, 291,

    section CallTarget+Inlining+NGEN
    This PR (7609) - mean (865ms)  : 839, 890
     .   : milestone, 865,
    master - mean (888ms)  : 850, 926
     .   : milestone, 888,

Loading

@lucaspimentel lucaspimentel merged commit 65761e2 into master Oct 3, 2025
85 of 147 checks passed
@lucaspimentel lucaspimentel deleted the lpimentel/update-agents-doc branch October 3, 2025 17:12
@github-actions github-actions bot added this to the vNext-v3 milestone Oct 3, 2025
igoragoli pushed a commit that referenced this pull request Oct 6, 2025
## Summary of changes

- Add performance optimization patterns, testing guidelines, and logging
guidelines to `AGENTS.md`.
- Bonus: Fix noop pipeline path exclusions to properly skip CI for
documentation-only PRs.

## Reason for change

**Documentation:** Document reusable patterns that apply broadly across
the tracer codebase:
- Performance patterns for startup code and hot paths (from PR #7594)
- Testing patterns for testability and isolation (from PR #7594)
- Logging terminology to avoid customer confusion (from PR #7467)

**CI Optimization:** The noop pipeline was not triggering for
documentation-only PRs because it uses `StartsWith()` matching, not glob
patterns. The `**/CLAUDE.md` pattern never matched `.claude/CLAUDE.md`.

## Implementation details

**New documentation sections:**
- Performance Guidelines: Identifies performance-critical code paths
(bootstrap/startup and hot paths)
- Performance Optimization Patterns: Zero-allocation structs, logging
best practices, avoiding params arrays
- Testing Patterns: Abstraction-for-testability with examples
- Logging Guidelines: Consistent customer-facing terminology (Datadog
SDK, Instrumentation, Continuous Profiler, Datadog.Trace.dll)

**Pipeline fixes:**
- Changed `**/CLAUDE.md` glob to `.claude/` prefix (compatible with
`StartsWith()`)
- Added `.devcontainer/`, `.vscode/`, `LICENSE`, `NOTICE` to exclusions

**Other changes:**
- Fixed `.claude/CLAUDE.md` relative path reference
- Improved formatting in Coding Style section

## Test coverage

N/A - documentation and CI configuration only

---------

Co-authored-by: Claude <[email protected]>
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.

3 participants