getsentry / getsentry/sentry-dotnet

Mobile Vitals

Open
#3,181 16 comments 3 reactions 1 assignee Claimed by @jamescrosswell View on GitHub
.NET 4: high Feature Framework: MAUI
Dominant language
C#
Stars
770
Forks
248
Avg merge
3d 4h
Merged PRs (30d)
49

Description

> \[!NOTE\]
Add maui [here to relay](<>) - otherwise maui spans wont get attributes like `device.class`
and on hybrids we get these device attributes directly from the native SDKs e.g `InternalSentrySdk.getCurrentScope()` in native Android api
>
> * ios needs `device.model`
> * android needs `device.processor_frequency`, `device.processor_count` and `device.memory_size`
sent as context / attribute on the span (and also on error events)

## Summary

What are [Mobile Vitals]()

### App start

[App Start]()

- [ ] getsentry/sentry-dotnet#5097
- [ ] getsentry/sentry-dotnet#5098

Initial React Native implementation here:

* [https://github.com/getsentry/sentry-react-native/pull/1704]()

The changelog has over 35 other mentions of App Start though so evolved quite a bit from there, including:

* [https://github.com/getsentry/sentry-react-native/pull/3852]()

Docs:

* [https://docs.sentry.io/platforms/react-native/tracing/instrumentation/automatic-instrumentation/#app-start-instrumentation]()

### Frame Delay

[Slow and Frozen Frames]()

- [ ] getsentry/sentry-dotnet#5099
- [ ] getsentry/sentry-dotnet#5100

#### Additional references

* [https://github.com/getsentry/team-mobile/issues/160]()
* [https://developer.android.com/topic/performance/vitals/launch-time]()

#### React Native implementation

Frozen frames, not Frame delay:

* [https://github.com/getsentry/sentry-react-native/issues/4931]()
* [https://github.com/getsentry/sentry-react-native/issues/4869]()

### TTID

[Time to Initial Display]()

- [ ] getsentry/sentry-dotnet#5101
- [ ] getsentry/sentry-dotnet#5102

Android:

* The Sentry Android SDK already includes FirstDrawDoneListener (an OnDrawListener on ViewTreeObserver). Since that SDK is embedded in our project, we may be able to call it
directly from the managed layer rather than reinventing it.

iOS:

* Everything hinges on SentryFramesTracker being active (enableAutoPerformanceTracing must be set). We need a one-shot listener callback from it — currentScreenFrames is already
in the bindings but the listener protocol for frame-by-frame callbacks likely isn't, so there's probably some Cocoa binding work needed.

Both platforms:

* The MAUI navigation equivalent of react-native-screens's ScreenAppearEvent / viewDidAppear is a MAUI page's OnAppearing — that's the natural hook point for starting frame
detection.

#### Additional References

* [https://github.com/getsentry/sentry-dart/issues/1780]()
* [https://github.com/getsentry/sentry-dart/pull/1910]()
* [https://github.com/getsentry/sentry-dart/pull/1920]()
* [https://changelog.getsentry.com/announcements/improving-mobile-screen-performance-with-ttid-ttfd]()

### Time to Full Display

[Time to Full Display]()

- [ ] getsentry/sentry-dotnet#5103
- [ ] getsentry/sentry-dotnet#5104

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.