Skip to content

Make lifecycle breadcrumbs logged by sentry-android-fragment integration customizable #1734

@mateuszkwiecinski

Description

@mateuszkwiecinski

Context

I tried to add FragmentLifecycleIntegration to my app, and I quickly reached default breadcrumbs limit. Almost all events came from FragmentLifecycleIntegration which decreased number of visible user interactions to last 2-3 screens before crash.
I could increase breadcrumbs limit, but I concluded I'd prefer see less events logged by FragmentLifecycleIntegration.

Proposal

The simples thing I can suggest is to introduce api like:

FragmentLifecycleIntegration(
	application = application,
	loggedLifecycleEvents = setOf(Lifecycle.State.RESUMED, Lifecycle.State.PAUSED),
)

which would skip events non-listed in new parameter.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions