Skip to content

Commit

Permalink
Added EnableNetworkEventBreadcrumbs to Native Android options (#3267)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell authored Apr 8, 2024
1 parent 8ec1f4c commit a6e38bf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- EnableNetworkEventBreadcrumbs can now be set on the Native Android options ([#3267](https://github.com/getsentry/sentry-dotnet/pull/3267))

### Fixes

- Fix missing exception StackTraces in some situations ([#3215](https://github.com/getsentry/sentry-dotnet/pull/3215))
Expand Down
2 changes: 2 additions & 0 deletions src/Sentry/Platforms/Android/BindableNativeSentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class NativeOptions
public bool? EnableAppComponentBreadcrumbs { get; set; }
public bool? EnableAppLifecycleBreadcrumbs { get; set; }
public bool? EnableRootCheck { get; set; }
public bool? EnableNetworkEventBreadcrumbs { get; set; }
public bool? EnableSystemEventBreadcrumbs { get; set; }
public bool? EnableUserInteractionBreadcrumbs { get; set; }
public bool? EnableAutoActivityLifecycleTracing { get; set; }
Expand All @@ -44,6 +45,7 @@ public void ApplyTo(SentryOptions.NativeOptions options)
options.EnableAppComponentBreadcrumbs = EnableAppComponentBreadcrumbs ?? options.EnableAppComponentBreadcrumbs;
options.EnableAppLifecycleBreadcrumbs = EnableAppLifecycleBreadcrumbs ?? options.EnableAppLifecycleBreadcrumbs;
options.EnableRootCheck = EnableRootCheck ?? options.EnableRootCheck;
options.EnableNetworkEventBreadcrumbs = EnableNetworkEventBreadcrumbs ?? options.EnableNetworkEventBreadcrumbs;
options.EnableSystemEventBreadcrumbs = EnableSystemEventBreadcrumbs ?? options.EnableSystemEventBreadcrumbs;
options.EnableUserInteractionBreadcrumbs = EnableUserInteractionBreadcrumbs ?? options.EnableUserInteractionBreadcrumbs;
options.EnableAutoActivityLifecycleTracing = EnableAutoActivityLifecycleTracing ?? options.EnableAutoActivityLifecycleTracing;
Expand Down
9 changes: 9 additions & 0 deletions src/Sentry/Platforms/Android/NativeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ internal NativeOptions(SentryOptions options)
/// </summary>
public bool EnableRootCheck { get; set; } = true;

/// <summary>
/// Gets or sets a value that indicates if automatic breadcrumbs for network events are enabled.
/// The default value is <c>true</c> (enabled).
/// </summary>
/// <remarks>
/// See https://docs.sentry.io/platforms/android/enriching-events/breadcrumbs/
/// </remarks>
public bool EnableNetworkEventBreadcrumbs { get; set; } = true;

/// <summary>
/// Gets or sets a value that indicates if automatic breadcrumbs for system events are enabled.
/// The default value is <c>true</c> (enabled).
Expand Down
1 change: 1 addition & 0 deletions src/Sentry/Platforms/Android/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ private static void InitSentryAndroidSdk(SentryOptions options)
o.EnableAppLifecycleBreadcrumbs = options.Native.EnableAppLifecycleBreadcrumbs;
o.EnableRootCheck = options.Native.EnableRootCheck;
o.EnableSystemEventBreadcrumbs = options.Native.EnableSystemEventBreadcrumbs;
o.EnableNetworkEventBreadcrumbs = options.Native.EnableNetworkEventBreadcrumbs;
o.EnableUserInteractionBreadcrumbs = options.Native.EnableUserInteractionBreadcrumbs;
o.EnableUserInteractionTracing = options.Native.EnableUserInteractionTracing;
Expand Down

0 comments on commit a6e38bf

Please sign in to comment.