Support Source Context
Originally posted on flutter: https://github.com/flutter/flutter/issues/63276
Users would like to see the source context around the stack trace. This is a feature supported in Python, JavaScript and other script languages. Native has this support with source bundles.
Currently blocked by https://github.com/dart-lang/sdk/issues/44325
Currently blocked by https://github.com/dart-lang/sdk/issues/44325
The linked issue mentions that most of it is now possible via --resolve-dwarf-paths.
Is that enough for us to work with?
Hello guys, any news about this issue? This is really important for us 😬
@augustorsouza we'd like to do it but we didn't spend much time investigating it yet, we don't even know if it's supported ootb by the flutter/dart tooling.
just to be clear, this is about showing the source code around the stack trace on sentry, not really related to source maps or anything, it's a nice feature indeed, but would you mind elaborating why is it important? interested in the use case, so we can prioritize.
For Web, it works at some degree, see https://github.com/getsentry/sentry-dart/issues/417#issuecomment-897480519
We'll test if the new flag --resolve-dwarf-paths works or if something else is needed.
https://github.com/dart-lang/sdk/issues/44325#issuecomment-826771991
Relates to: https://github.com/getsentry/sentry-java/issues/633
@vaind do you know if this is possible after your PRs on Dart/Flutter language/engine?
@vaind do you know if this is possible after your PRs on Dart/Flutter language/engine?
not out of the top of my head, I'll check
https://github.com/getsentry/sentry-dart-plugin already supports include_native_sources
we'd need to upload debug symbols with this flag enabled when compiling with --split-debug-info and without, since the process changes a little bit.
My hunch is that it works for Android if --split-debug-info is enabled at least, if disabled not sure.
iOS does not work at all https://github.com/getsentry/team-mobile/issues/42#issuecomment-1305602466
I've managed (with a custom flutter build) to get an issue with absolute paths to sentry.io from Android. Weirdly though, each stacktrace source path contains "dispose" somewhere in the path - see https://sentry.io/organizations/sentry-sdks/issues/3734649639/events/1f7d76d638bf44dd8c069bc0a15c260f/?project=5428562
No idea where that comes from because the stack trace coming from flutter symbolize doesn't have that, see https://github.com/dart-lang/sdk/issues/44325#issuecomment-1311728421
edit: the same "dispose" is in the path on iOS: https://sentry.io/organizations/sentry-sdks/issues/3734649639/events/78f08f5fcd75451db6a64161b4b0133c/?project=5428562 - likely something we're adding along the way
As for web, I'm confused... this issue linked above says it should work, but for some reason, It doesn't for me: https://sentry.io/organizations/sentry-sdks/issues/3734775388/events/e14d18b2b90c4c97815245624ed4757e/?project=5428562
I've managed (with a custom flutter build) to get an issue with absolute paths to sentry.io from Android. Weirdly though, each stacktrace source path contains "dispose" somewhere in the path - see sentry.io/organizations/sentry-sdks/issues/3734649639/events/1f7d76d638bf44dd8c069bc0a15c260f/?project=5428562
No idea where that comes from because the stack trace coming from
flutter symbolizedoesn't have that, see dart-lang/sdk#44325 (comment)edit: the same "dispose" is in the path on iOS: sentry.io/organizations/sentry-sdks/issues/3734649639/events/78f08f5fcd75451db6a64161b4b0133c/?project=5428562 - likely something we're adding along the way
Does the SDK set that in the absPath or is that during symbolication on the server? just asking cus I can check with the stack trace team.
Does the SDK set that in the
absPathor is that during symbolication on the server? just asking cus I can check with the stack trace team.
I've checked that last week and didn't find any occurrence of the "dispose" as a string anywhere in the dart, java or native SDK.
just asking cus I can check with the stack trace team.
please do - I've posted on discord in the dwarf channel (for the lack of a better place) to no avail yet.
As for web, I'm confused... this issue linked above says it should work, but for some reason, It doesn't for me: sentry.io/organizations/sentry-sdks/issues/3734775388/events/e14d18b2b90c4c97815245624ed4757e/?project=5428562
There's no uploaded sourcemaps for this release.
There's no uploaded sourcemaps for this release.
hmm, that looks like an error. SENTRY_RELEASE env var is set in run.sh but maybe not picked up properly by the dart plugin. I'll check
web - it loaded the cached version from a previous run. when I made sure I use the version I've just built, in-app source codes work fine - https://sentry.io/organizations/sentry-sdks/issues/3741285487/events/0c0429bd595840b6a5117b755a3f0da8/?project=5428562
@vaind I believe this is completed on our side and it works OOTB when the source context is uploaded, right?
Do we have to document the usage of --resolve-dwarf-paths? do people need to use the master channel of Dart and/or Flutter still?
@marandaneto not at all, there's an open PR on Flutter to enable this option (https://github.com/flutter/flutter/pull/114767) and there's an UI issue that the sources don't show up on sentry.io (looking into that - https://discord.com/channels/621778831602221064/809895882987536395/1068962301228617830)
UI work is being tracked here. I will ping folks for that.
UI is fixed and the flutter PR has landed as well. In other words, this is "done" and should start working automatically with the next Flutter release. I'll keep my eye on this and check in a couple of days against Flutter master to see if everything seems in order.
Keeping the issue open for now
@vaind did you manage to check whether this is working now?
Works with the latest beta tag (but not in with the flutter channel beta yet because that one is on 3.8.0-10.1.pre)
Flutter 3.8.0-17.0.pre • channel unknown • unknown source
Framework • revision 1d17caed66 (6 days ago) • 2023-02-27 23:11:38 -0500
Engine • revision 002b3d7a24
Tools • Dart 3.0.0 (build 3.0.0-277.0.dev) • DevTools 2.22.1
https://sentry-sdks.sentry.io/issues/3979346432/events/a64d54c3c3a44eeba76ddf22f2bf9800/?project=5428562
