-
-
Notifications
You must be signed in to change notification settings - Fork 226
Breadcrumbs documentation for device events #213
Comments
@ueman good catch. Is this something you'd like to contribute to? |
No, I'm not knowledgeable enough on that topic. I've just stumbled across this missing pieces while working on getsentry/sentry-dart#203 |
Sure. Thanks for helping already with pointing it out. |
On the Flutter side of https://github.com/getsentry/sentry-dart there are the following breadcrumbs: 🗺 NavigationWith the following extra data fields {
"type": "navigation",
"category": "navigation",
"timestamp": "2016-04-20T20:55:53.845Z",
"data": {
"from": "/login",
"from_arguments": "string or key-value-map",
"to": "/dashboard",
"to_arguments": "string or key-value-map",
"state": "type of navigation, for example didPush"
}
} Navigation LifecycleThis one doesn't really make sense to me. Why is category {
"type": "navigation",
"category": "ui.lifecycle",
"timestamp": "2016-04-20T20:55:53.845Z",
"data": {
"state": "new lifecycle state"
}
} Navigation DeviceSame as above, why is it of type {
"message": "Screen size changed",
"type": "navigation",
"category": "device.screen",
"timestamp": "2016-04-20T20:55:53.845Z",
"data": {
"new_pixel_ratio": 3,
"new_height": 1920,
"new_width": 1080,
}
} 💻 SystemThis was created to mimic this. Again just to be consistent. {
"message": "Platform brightness was changed to {dark|light}.",
"type": "system",
"category": "device.event",
"timestamp": "2016-04-20T20:55:53.845Z",
"data": {
"action": "BRIGHTNESS_CHANGED_TO_{DARK|LIGHT}",
}
} {
"message": "Text scale factor changed to {value}.",
"type": "system",
"category": "device.event",
"timestamp": "2016-04-20T20:55:53.845Z",
"data": {
"action": "TEXT_SCALE_CHANGED_TO_{value}",
}
} {
"message": "App had memory pressure. This indicates that the operating system would like applications to release caches to free up more memory.",
"type": "system",
"category": "device.event",
"timestamp": "2016-04-20T20:55:53.845Z",
"data": {
"action": "LOW_MEMORY"
}
} ❓ Concluding remarks & questionsIt doesn't seem to be really consistent to me.
I would really like to have examples for common breadcrumbs like |
/cc @marandaneto |
Sentry frontend code for reference |
@lucas-zimerman for the Xamarin side |
it's a bit confusing, true, but there's no guideline between most of them are new values that we came up with for Android and iOS also to keep compatibility with older SDK versions. maybe @priscilawebdev would help. |
@priscilawebdev is this something you can help us with? This seems to be a constant source of confusion to contributors and folks trying to implement a new SDK. Some clarifications on the docs could help here. |
@bruno-garcia I'm glad you mentioned my name again because I was having trouble finding this issue ... Yes, I can help with that ... I just added this issue to my backlog and I will work on it as soon as I have some time 😉 |
So what exactly would need to be done here?
|
Dart & FlutterAlready documented above JavaDevice Orientationfinal Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.setType("navigation");
breadcrumb.setCategory("device.orientation");
breadcrumb.setData("position", orientation);
breadcrumb.setLevel(SentryLevel.INFO); Low Memoryfinal Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.setType("system");
breadcrumb.setCategory("device.event");
breadcrumb.setMessage("Low memory");
breadcrumb.setData("action", "LOW_MEMORY");
breadcrumb.setLevel(SentryLevel.WARNING); Lifecyclefinal Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.setType("navigation");
breadcrumb.setData("state", state);
breadcrumb.setCategory("app.lifecycle");
breadcrumb.setLevel(SentryLevel.INFO); final Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.setType("session");
breadcrumb.setData("state", state);
breadcrumb.setCategory("app.lifecycle");
breadcrumb.setLevel(SentryLevel.INFO); Temperature Sensorfinal Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.setType("system");
breadcrumb.setCategory("device.event");
breadcrumb.setData("action", "TYPE_AMBIENT_TEMPERATURE");
breadcrumb.setData("accuracy", event.accuracy);
breadcrumb.setData("timestamp", event.timestamp);
breadcrumb.setLevel(SentryLevel.INFO);
breadcrumb.setData("degree", event.values[0]); // Celsius Phone Statefinal Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.setType("system");
breadcrumb.setCategory("device.event");
breadcrumb.setData("action", "CALL_STATE_RINGING");
breadcrumb.setMessage("Device ringing");
breadcrumb.setLevel(SentryLevel.INFO); System eventsHere's a lot of different stuff. CocoaBatterySentryBreadcrumb *crumb = [[SentryBreadcrumb alloc] initWithLevel:kSentryLevelInfo
category:@"device.event"];
crumb.type = @"system";
crumb.data = batteryData; Device OrientationSentryBreadcrumb *crumb = [[SentryBreadcrumb alloc] initWithLevel:kSentryLevelInfo
category:@"device.orientation"];
UIDeviceOrientation currentOrientation = currentDevice.orientation;
// Ignore changes in device orientation if unknown, face up, or face down.
if (!UIDeviceOrientationIsValidInterfaceOrientation(currentOrientation)) {
[SentryLog logWithMessage:@"currentOrientation is unknown." andLevel:kSentryLevelDebug];
return;
}
if (UIDeviceOrientationIsLandscape(currentOrientation)) {
crumb.data = @{ @"position" : @"landscape" };
} else {
crumb.data = @{ @"position" : @"portrait" };
}
crumb.type = @"navigation"; System events
XamarinXamarin FormsVarious System events
Xamarin.iOS
Xamarin.Android
.NET
Cordova
React-Native
JavaScript
Laravel
NavigationIntegration::addBreadcrumb(new Breadcrumb(
Breadcrumb::LEVEL_INFO,
Breadcrumb::TYPE_NAVIGATION,
'route',
$routeName
)); Python
SentryKnown types in Sentry Documented types: https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ Findings
|
The breadcrumbs types should be added to https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ |
The documentation on breadcrumbs is missing device events like the ones which are used by Android.
See for example:
The text was updated successfully, but these errors were encountered: