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

Add breadcrumbs to Sentry for all analytics events #1733

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshuatbrown
Copy link
Contributor

Issues covered

https://github.com/verse-pbc/issues/issues/125

Description

Adds breadcrumbs to Sentry whenever an analytics event happens.

How to test

I'm really not sure. The app should keep working as it was before. But do these breadcrumbs show up in Sentry? I'm not sure how to find out. I think it would require us to create a crash or error since breadcrumbs only show up in those in Sentry; I don't think there's a separate view for them. But I could be wrong.

Screenshots/Video

None

Comment on lines +315 to +323
/// Adds a breadcrumb for the given event name for tracking in our error reporting tool (Sentry).
/// - Parameter eventName: The event for which to add a breadcrumb.
private func trackBreadcrumb(_ eventName: String) {
let crumb = Breadcrumb()
crumb.level = SentryLevel.info
crumb.category = "analytics"
crumb.message = eventName
SentrySDK.addBreadcrumb(crumb)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be in CrashReporting, and perhaps Analytics can call it. Still not sure if Analytics should depend on CrashReporting but I am sure this code goes in CrashReporting.

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.

1 participant