Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support eventMapper on crashes for logs #1741

Merged
merged 4 commits into from
Mar 27, 2024

Conversation

fuzzybinary
Copy link
Member

@fuzzybinary fuzzybinary commented Mar 20, 2024

What and why?

This adds a call to the configured log event mapper when a crash is reported to the Logs feature. It's tested in the integration test app by adding a fingerprint to the reported crash.

refs: RUM-2209

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests for Core, RUM, Trace, Logs, CR and WVT
  • Run unit tests for Session Replay
  • Run integration tests
  • Run smoke tests
  • Run tests for tools/

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 21, 2024

Datadog Report

Branch report: jward/RUM-2206-log-event-mapper
Commit report: 8d702b1
Test service: dd-sdk-ios

✅ 0 Failed, 2633 Passed, 0 Skipped, 23m 22.93s Wall Time
🔻 Test Sessions change in coverage: 6 decreased, 5 increased, 3 no change

🔻 Code Coverage Decreases vs Default Branch (6)

This report shows up to 5 code coverage decreases.

  • test DatadogRUMTests tvOS 79.74% (-0.09%) - Details
  • test DatadogCoreTests tvOS 79.88% (-0.06%) - Details
  • test DatadogTraceTests tvOS 49.71% (-0.03%) - Details
  • test DatadogLogsTests tvOS 45.97% (-0.01%) - Details
  • test DatadogLogsTests iOS 45.92% (-0.01%) - Details

@fuzzybinary fuzzybinary marked this pull request as ready for review March 21, 2024 15:38
@fuzzybinary fuzzybinary requested review from a team as code owners March 21, 2024 15:38
Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Looks good 👍 would be convenient to default the mapper to nil in the crash receiver, WDYT?

Comment on lines 193 to +194
let dateProvider: DateProvider
let logEventMapper: LogEventMapper?
Copy link
Member

Choose a reason for hiding this comment

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

/siggestion For convenience, we can have an init that default the mapper to nil

Copy link
Member Author

Choose a reason for hiding this comment

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

Since this in internal, I thought it would be good to enforce adding it / explicitly setting it to nil. I can add the default if you disagree.

Copy link
Member

Choose a reason for hiding this comment

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

I also prefer being explicit. This way compiler will guide us on all the places where MessageReceiver is used and will make us think of injecting mapper where it makes sense. If we seek for testing convenience, it is safer to add it through extension in test module.

ncreated
ncreated previously approved these changes Mar 26, 2024
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

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

👍 Looks good, but please add CHANGELOG entry 🙂

Added the changelog item for Log mapper being called for crashes.
@fuzzybinary fuzzybinary merged commit c56e2be into develop Mar 27, 2024
8 checks passed
@fuzzybinary fuzzybinary deleted the jward/RUM-2206-log-event-mapper branch March 27, 2024 12:45
@ncreated ncreated mentioned this pull request Apr 4, 2024
8 tasks
@maxep maxep mentioned this pull request Apr 10, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants