Skip to content

Conversation

@ueman
Copy link
Collaborator

@ueman ueman commented Aug 20, 2021

📜 Description

This change adds the current route as SentryEvent.transaction.

💡 Motivation and Context

https://develop.sentry.dev/sdk/event-payloads/ suggests to use the current route as transaction name.

💚 How did you test it?

Unit tests

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2021

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.40%. Comparing base (36e4db2) to head (929e61b).
⚠️ Report is 1715 commits behind head on main.

Files with missing lines Patch % Lines
.../lib/src/navigation/sentry_navigator_observer.dart 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #560      +/-   ##
==========================================
- Coverage   91.42%   91.40%   -0.02%     
==========================================
  Files          75       75              
  Lines        2471     2479       +8     
==========================================
+ Hits         2259     2266       +7     
- Misses        212      213       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ueman ueman marked this pull request as ready for review August 20, 2021 16:08
@ueman ueman requested a review from marandaneto as a code owner August 20, 2021 16:08
@marandaneto
Copy link
Contributor

although this makes sense, it'd conflict with the performance API that comes next, since this field kinda got changed, let's not merge for now

@ueman
Copy link
Collaborator Author

ueman commented Oct 6, 2021

@marandaneto Should this still be considered or can this be closed?

I mean it kinda makes sense if performance tracing is disabled.

Comment on lines +232 to +233
final hub = _MockHub();
final observer = SentryNavigatorObserver(hub: hub, setTransaction: true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can make a fixture


final Hub hub;
final Hub _hub;
final bool setTransaction;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can make it private and probably give a better naming, also writing in the ctor docs that enabling this overwrites the current transaction name in the scope.

about the name, maybe routeNameAsTransactionName not sure, but setTransaction only is too subjective IMO

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't be made private because it's a named constructor argument. Though because it's final it's basically readonly.

@marandaneto
Copy link
Contributor

@marandaneto Should this still be considered or can this be closed?

I mean it kinda makes sense if performance tracing is disabled.

still makes sense, I did a review, would u like to work on it? so we can merge, thanks for doing this btw.

));
}

void setCurrentRoute(String? name) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should happen if the route name is null?
Resetting the transaction name to null or just nothing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing I'd say, but I guess the route is never null anyway

@ueman
Copy link
Collaborator Author

ueman commented Oct 7, 2021

Closed this in favor of #615 because I don't have the rights anymore.

@ueman ueman closed this Oct 7, 2021
@marandaneto marandaneto deleted the feat/transaction-name branch December 10, 2021 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants