sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Java.Lang.IllegalArgumentException when setting MaxBreadcrumbs to 0

Open jamescrosswell opened this issue 1 year ago • 3 comments

Description

Originally raised in the sentry-dotnet repository (as the SDK users is building for Android using MAUI):

  • https://github.com/getsentry/sentry-dotnet/issues/3255

The exception is being thrown by the sentry-java SDK however.

jamescrosswell avatar Apr 03 '24 22:04 jamescrosswell

@jamescrosswell there's BeforeBreadcrumbCallback on SentryOptions in the Java SDK, not sure if that can help create a workaround for this user by always returning null and thus dropping all breadcrumbs.

adinauer avatar Apr 04 '24 05:04 adinauer

@jamescrosswell there's BeforeBreadcrumbCallback on SentryOptions in the Java SDK, not sure if that can help create a workaround for this user by always returning null and thus dropping all breadcrumbs.

Thanks @adinauer, yes that's what I've suggested as a workaround for the time being... well technically I suggested using the SetBeforeBreadcrumb callback on the .NET options, but this gets hooked up the the Java SDK BeforeBreadcrumbCallback under the hood.

I think the customer has correctly identified a discrepancy between the docs and the SDK behaviour though so we should probably adress one or the other of those things eventually.

jamescrosswell avatar Apr 04 '24 06:04 jamescrosswell

decision: when maxBreadcrumbs is set to 0 we should disable breadcrumbs

stefanosiano avatar Apr 10 '24 13:04 stefanosiano