Skip to content

Commit

Permalink
Merge pull request #5381 from EdgeApp/sam/EdgeCrashEvents
Browse files Browse the repository at this point in the history
Improve EdgeCrashEvent reporting
  • Loading branch information
samholmes authored Dec 4, 2024
2 parents 90a0e1a + 3315ed3 commit df993ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- added: New Kado OTC provider integration.
- changed: Improved EdgeCrashEvent reporting with additional metadata, tags, and name/message information.
- changed: Integrate `installSurvey` endpoint for post-install survey options

## 4.19.0
Expand Down
20 changes: 14 additions & 6 deletions src/components/services/EdgeCoreManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,24 @@ const crashReporter: EdgeCrashReporter = {
},
logCrash(event) {
// Index the crash error by the source and original error name:
const error = new Error(`${event.source}: ${String(event.error)}`)
const error = new Error(String(event.error))
// All of these crash errors are grouped together using this error name:
error.name = 'EdgeCrashLog'
error.name = 'EdgeCrashEvent'

captureException(error, scope => {
scope.setLevel('fatal')

const context: Record<string, unknown> = {}
addMetadataToContext(context, event.metadata)
scope.setContext('Edge Crash Metadata', context)
scope.setTags({ crashSource: event.source })

const metadataContext: Record<string, unknown> = {}
addMetadataToContext(metadataContext, event.metadata)
scope.setContext('EdgeCrashEvent Metadata', metadataContext)

const detailsContext: Record<string, unknown> = {}
addMetadataToContext(detailsContext, {
source: event.source,
time: event.time
})
scope.setContext('EdgeCrashEvent Details', detailsContext)

return scope
})
Expand Down

0 comments on commit df993ef

Please sign in to comment.