feat: [Trace Stats] Add skeleton of concentrator by lym953 · Pull Request #842 · DataDog/datadog-lambda-extension

Base automatically changed from yiming.luo/trace-stats-4 to main

September 17, 2025 16:29

@lym953 lym953 marked this pull request as ready for review

September 17, 2025 18:36

@lym953 lym953 marked this pull request as ready for review

September 19, 2025 17:01

duncanista

duncanista

duncanista

@lym953 lym953 deleted the yiming.luo/trace-stats-5 branch

September 19, 2025 18:05

lym953 added a commit that referenced this pull request

Sep 22, 2025
## This PR
1. Move stats generation after trace obfuscation, which is the correct
order as suggested by Trace Agent team. Right now stats generation is
before trace obfuscation.
2. Also generate trace stats for OTLP agent. Right now we only do it for
trace agent.

## Architecture
Copied from #842
<img width="1296" height="674" alt="image"
src="https://github.com/user-attachments/assets/2d4cb925-6cfc-4581-8ed6-6bd87cf0d87a"
/>

## Testing
Tested in the next PR
#856, which
implements stats concentrator. Trace stats appeared in Datadog.
<img width="538" height="317" alt="image"
src="https://github.com/user-attachments/assets/48b849cc-2413-41d5-8576-5ff657c21a0f"
/>


## Next steps
1. Implement `StatsConcentrator`
2. Rename for clarity:
  - `SendingTraceStatsProcessor` -> `TraceStatsGenerator`
  - `stats_sender` -> `stats_generator`
3. Small refactor: consider passing around `stats_sender` instead of
`stats_concentrator_handle`. Right now
`SendingTraceStatsProcessor::new()` is called in three places. It might
be possible to call it only once then pass it around.

## Notes
Jira: https://datadoghq.atlassian.net/browse/SVLS-7593