✨ attach debug_ids to logs events - #4982
Conversation
Forward the `debugIds` resolved from the source code context to logs events as `_dd.debug_ids`, for runtime errors, console errors, reports and manual `logger.error` calls. Reports now derive both their stack and their debug ids from a single source location. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ce159bdf3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Extend debug id attachment to network error logs by exporting getStackTraceUrls and reusing it in networkErrorCollection to derive debug_ids from the computed stack trace. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bundles Sizes Evolution
|
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: d9f9d08 | Docs | View more details | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a0b818459
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| message: logsMessage.message, | ||
| status: logsMessage.status, | ||
| origin: ErrorSource.LOGGER, | ||
| _dd: { debug_ids: logsMessage.debugIds }, |
There was a problem hiding this comment.
Omit
_dd when no debug IDs exist
issue: For every HTTP-handled logger call without resolved debug IDs—including ordinary DD_LOGS.logger.info('message') calls—this unconditionally adds _dd: { debug_ids: undefined }. Assembly preserves the wrapper, so beforeSend, bridge consumers, and serialized intake events receive an unexpected _dd: {}; the updated startLogs.spec.ts confirms this wire-shape regression. Construct _dd conditionally, as the network-error path does, so logs unrelated to debug IDs retain their previous callback and payload shape.
Useful? React with 👍 / 👎.
3a0b818 to
d9f9d08
Compare
Motivation
Part of the sourcemap unminification project. RUM error / long task / profiler events already carry
_dd.debug_ids. This does the same for the Logs SDK, so minified stacks collected through@datadog/browser-logscan be unminified too.Changes
_dd.debug_idsis now attached to logs events from:runtimeErrorCollection,consoleCollection,reportCollection,loggerTest instructions
yarn test:e2e -g "debug_id"Checklist