-
-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rewrite frames integration #2111
Comments
@buenaflor I created this issue as we only talked in Discord about this. Is this still correct and something we want to do? |
Yep, the most simplest way is to tell users to modify the abs path of the stackframes in I think we're fine in just adding the guide to configure it like so : beforeSendCallback: (event, hint) async {
final exceptions = event.exceptions?.map((exception) {
final stackTrace = exception.stackTrace;
if (stackTrace != null) {
final frames = stackTrace.frames.map((frame) {
const baseUrl = 'https://example.com/';
final modifiedAbsPath = frame.absPath?.replaceFirst(baseUrl, '${baseUrl}my_prefix/');
return frame.copyWith(absPath: modifiedAbsPath);
}).toList();
return exception.copyWith(stackTrace: SentryStackTrace(frames: frames));
}
return exception;
}).toList() ?? [];
return event.copyWith(exceptions: exceptions);
}); a specific rewrite frames integration is overkill for now |
abs_path
with urlPrefix
Added to docs: getsentry/sentry-docs#10470 We could also add the sample in the sentry-dart-plugin |
let's do that |
We could add a rewrite frames integration similar to javascript that allows users to manipulate the frames in a specific way before sending them off.
Examples of what it would solve
Relates to getsentry/sentry-dart-plugin#222
When users provide a
urlPrefix
withsentry-dart-plugin
andsentry-cli
, stack traces are not resolved correctly, as the path cant be found.the stack trace abs path is
"http://localhost: 8900/main.dart
.the uploaded file is
~/foo/main.dart
-> doesn't matchso you would need to rewrite the abs_path to the uploaded file to include the prefix.
With a rewrite frame integration it would be easy to do that.
Alternatives
Use beforeSend code snippet
Demand
Please upvote if you are interested in such an integration
The text was updated successfully, but these errors were encountered: