Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Conversation

@bruno-garcia
Copy link
Mannequin

@bruno-garcia bruno-garcia mannequin commented Nov 22, 2023

Adds Sentry.Maui, initializes with the app. And configures msbuild to upload symbols automatically.

Before merging we'd need to change csproj props to take a different Sentry account (not my test one).

Added some sample buttons to make different crashes. We can remove them before merging. Or hide them somehow to be able to test things out easily.

Version is a beta right now, but the team is working on a final release soon (weeks away).

Android

A managed C# exception, with source context:

image

Note that Sentry does give you line numbers for Android crashes in Release builds published on the stores.

This is a crash done from C (P/Invoked):

image

Notice there's actually no line number. That's because the native library that crashed didn't get uploaded, this was fixed today and will be out on the next release of the SDK:

Some of the Android context:
image

iOS

Example iOS Simulator managed crash:

image
image
image
image

I'm getting an issue with the simulator though we need to look at.

Debug files

Sentry supports Portable PDB (.NET) but also DWARF, ELF, ProGuard, etc. It gets uploaded with the MSBuild. You'll see it in the logs.

 Preparing upload to Sentry for project 'App' (Debug/net8.0-ios): collecting debug symbols from bin/Debug/net8.0-ios/iossimulator-arm64/
  > Found 98 debug information files (30 with embedded sources)
  > Prepared debug information files for upload
  > Nothing to upload, all files are on the server

This log was on a second build without code changes but shows on the terminal during dotnet build
And you can see it in Sentry too:

image

Other features

We can get performance monitoring going but there's that creates transactions automatically yet so would need a bit of code. It's in the plan though.

It does pass a trace-id to the backend so you can link errors that happen on your app with anything on the backend. Super useful for debugging stuff.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

@CLAassistant
Copy link
Mannequin

CLAassistant mannequin commented Nov 22, 2023

CLA assistant check
All committers have signed the CLA.

@bitwarden-bot
Copy link
Mannequin

bitwarden-bot mannequin commented Nov 22, 2023

Thank you for your contribution! We've added this to our internal Community PR board for review.
ID: PM-4914

@bitwarden-bot bitwarden-bot mannequin changed the title Sentry MAUI for crash reporting [PM-4914] Sentry MAUI for crash reporting Nov 22, 2023
@dbosompem
Copy link
Mannequin

dbosompem mannequin commented Jan 8, 2024

Hi @bruno-garcia , thanks for your contribution. However there are some upcoming changes for our mobile app which is quite significant, and unfortunately this contribution doesn’t align with that direction. Thank you again for the help!

@dbosompem dbosompem mannequin closed this Jan 8, 2024
@bruno-garcia
Copy link
Mannequin Author

bruno-garcia mannequin commented Jan 8, 2024

I understand. Good luck with the changes and the MAUI migration.
If you're keen to give it a try in the future, I'm happy to open another PR.
Cheers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants