♻️ Merge message context into raw logs event at collection time - #5009
♻️ Merge message context into raw logs event at collection time#5009BenoitZugmeyer wants to merge 1 commit into
Conversation
The messageContext field was carried separately through the logs lifecycle and merged into the event during assembly. Merge it directly into rawLogsEvent at collection time instead, simplifying the data flow and removing the dedicated field on RawLogsEventCollectedData.
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: fdfea55 | Docs | View more details | Give us feedback! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdfea55f77
ℹ️ 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".
Motivation
This is a small refactor that will simplify #4920
Logs collection carried the user-provided message context as a separate
messageContextfield through the lifecycle, only to merge it into the event during assembly. This indirection added complexity to the data flow for no benefit, since the context is always meant to end up on the log event itself.Changes
messageContextdirectly intorawLogsEventat collection time (console, logger, and runtime error sources) usingcombine, preserving the existing precedence (message context overrides base event fields).messageContextfield fromRawLogsEventCollectedData.CommonRawLogsEventso user context fields are accepted by the type system.Test instructions
DD_LOGS.logger.log('hello', { foo: 'bar' })) and confirm the context fields appear on the sent log event.message) overrides the native value in the sent event.Checklist