Skip to content

Conversation

@smeubank
Copy link
Contributor

@smeubank smeubank commented Apr 9, 2025

Without the SentryNavigatorObserver tracing with spans and errors on page loads and navigations doesn't work OOTB

This adds SentryNavigatorObserver() to config snippets in the main page and manual

  • only added to the config snippets when tracing is enabled
image

Open points:

  • it is a bit confusing as a follow up to wizard to have any config
  • what doesn't the wizard do?
  • explanation for the SentryWidget and SentryNavigatorObserver is needed in these docs. As I don't get what changes in the product experience from this config
  • do i need all this dart and custom?
  • i think an image of a page load with an error would help here for the "reason why"
  • these changes are the same in both files, should it be an include?

Without the SentryNavigatorObserver tracing with spans and errors on page loads and navigations doesn't work OOTB

This adds SentryNavigatorObserver() to config snippets in the main page and manual

- it is a bit confusing as a follow up to wizard to have any config
- what doesn't the wizard do?
- explanation for the SentryWidget and SentryNavigatorObserver is needed in these docs. As I don't get what changes in the product experience from this config
- do i need all this dart and custom?
- i think an image of a page load with an error would help here for the "reason why"
- these changes are the same in both files, should it be an include?
@vercel
Copy link

vercel bot commented Apr 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2025 11:06am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Apr 9, 2025 11:06am
develop-docs ⬜️ Ignored (Inspect) Apr 9, 2025 11:06am

@smeubank smeubank requested a review from buenaflor April 9, 2025 10:52
@codecov
Copy link

codecov bot commented Apr 9, 2025

Bundle Report

Changes will decrease total bundle size by 15 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 11.13MB -9 bytes (-0.0%) ⬇️
sentry-docs-client-array-push 9.47MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.75MB -0.0%
../instrumentation.js -3 bytes 1.08MB -0.0%
9523.js -3 bytes 1.05MB -0.0%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 868.7kB -0.0%
static/chunks/8165-*.js -3 bytes 410.1kB -0.0%
static/v09qs3CPsjl8j3ZNb6m9I/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/v09qs3CPsjl8j3ZNb6m9I/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/2ggWBO4-*.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/2ggWBO4-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Comment on lines +88 to +92
// When tracing is enabled, add SentryNavigatorObserver to connect
// page navigations, spans, and errors in a single trace
navigatorObservers: [
SentryNavigatorObserver()
],
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not added to a generic MyApp, it will depend on what framework the user uses

for example:

final router = GoRouter(
  routes: ...,
  observers: [SentryNavigatorObserver()],
);

vs

return MaterialApp(
  title: 'My Widget',
  home: MyWidget(),
  navigatorObservers: [
    SentryNavigatorObserver()
  ],
);

Not sure how we are going to unify this

Copy link
Contributor Author

@smeubank smeubank Apr 14, 2025

Choose a reason for hiding this comment

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

@buenaflor how many frameworks are there? is there a finite number of options, or is that there are X frameworks, and then they can also just do it free form to extent however they want?

Is there a to 2-3 ways a user might set it up?

Copy link
Contributor

@buenaflor buenaflor Apr 14, 2025

Choose a reason for hiding this comment

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

there are plenty frameworks but according to download stats these two are the most popular (the first one above is GoRouter a 3rd party package and the second one is the default one provided by Flutter)

Maybe we could add a note that for all other cases the user has to add the navigatorobserver manually but don't provide exact instructions how?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants