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

RUM-5248 feat: send memory warning as RUM error #1955

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

ganeshnj
Copy link
Contributor

@ganeshnj ganeshnj commented Jul 10, 2024

What and why?

memory warnings are not reported, with WT now in place these warnings can be helpful to get bigger picture and root cause the WT.

How?

Initial plan was to setup a context observer which will listen to memory warnings but the current dependency management around backtrace tracking doesn't allow generating a backtrace in DatadogContextProvider. This would have been a generic solution where any target can listen to memory warnings but had to drop this idea.

Instead, I added MemoryWarningMonitor which monitors the memory warnings and reports them when they occur.

Reporting part is kept outside the monitor to keep the monitor simple and testable.

Model update DataDog/rum-events-format#215

PS: I had the context observer working property basis which can be retrieved from cd9c78d if needed in future.

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 Session Replay

@ganeshnj ganeshnj changed the title Send memory warning as RUM error RUM-5248 Send memory warning as RUM error Jul 15, 2024
@ganeshnj ganeshnj force-pushed the ganeshnj/feat/memory-warning-errors branch 2 times, most recently from eb6a253 to cd9c78d Compare July 15, 2024 13:33
@ganeshnj ganeshnj changed the title RUM-5248 Send memory warning as RUM error RUM-5248 feat: send memory warning as RUM error Jul 17, 2024
@ganeshnj ganeshnj force-pushed the ganeshnj/feat/memory-warning-errors branch from cd9c78d to 3f527c3 Compare July 17, 2024 11:12
@ganeshnj ganeshnj force-pushed the ganeshnj/feat/memory-warning-errors branch from 3f527c3 to d03a5bf Compare July 17, 2024 11:20
@ganeshnj ganeshnj marked this pull request as ready for review July 17, 2024 11:22
@ganeshnj ganeshnj requested review from a team as code owners July 17, 2024 11:22
ncreated
ncreated previously approved these changes Jul 18, 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 great 🎯 🏅 with minor comments. Well done!

CHANGELOG.md Outdated
@@ -2,6 +2,7 @@

- [FEATURE] Enable DatadogCore, DatadogLogs and DatadogTrace to compile on watchOS platform. See [#1918][] (Thanks [@jfiser-paylocity][]) [#1946][]
- [IMPROVEMENT] Ability to clear feature data storage using `clearAllData` API. See [#1940][]
- [IMPROVEMENT] Send memory warning as RUM error.
Copy link
Member

Choose a reason for hiding this comment

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

change-request/ We're missing PR ID here, making it harder to combine release notes when shipping next release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

DatadogRUM/Sources/DataModels/RUMDataModels.swift Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
@@ -2,6 +2,7 @@

- [FEATURE] Enable DatadogCore, DatadogLogs and DatadogTrace to compile on watchOS platform. See [#1918][] (Thanks [@jfiser-paylocity][]) [#1946][]
- [IMPROVEMENT] Ability to clear feature data storage using `clearAllData` API. See [#1940][]
- [IMPROVEMENT] Send memory warning as RUM error.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

DatadogRUM/Sources/DataModels/RUMDataModels.swift Outdated Show resolved Hide resolved
@ganeshnj ganeshnj merged commit 10ee5b8 into develop Jul 18, 2024
16 checks passed
@ganeshnj ganeshnj deleted the ganeshnj/feat/memory-warning-errors branch July 18, 2024 12:23
@ncreated ncreated mentioned this pull request Jul 25, 2024
3 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.

2 participants