-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Onboarding wizard for errors + replay + performance #6633
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
Onboarding wizard for errors + replay + performance #6633
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/wizard/javascript/angular/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angular/with-error-monitoring-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angular/with-error-monitoring-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/remix/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/remix/with-error-monitoring-performance-and-replay.md
Outdated
Show resolved
Hide resolved
import * as Sentry from "@sentry/remix"; | ||
|
||
Sentry.init({ | ||
dsn: "___DSN___", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prisma here on errors only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prisma is only for perf - changed with c5b4fc0
src/wizard/javascript/remix/with-error-monitoring-performance-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/svelte/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
### ErrorHandler and Tracer | ||
|
||
The Sentry Angular SDK exports a function to instantiate `ErrorHandler` provider that will automatically send JavaScript errors captured by the Angular's error handler. | ||
|
||
```javascript | ||
import { APP_INITIALIZER, ErrorHandler, NgModule } from "@angular/core"; | ||
import { Router } from "@angular/router"; | ||
// import * as Sentry from "@sentry/angular" // for Angular 10/11 instead | ||
import * as Sentry from "@sentry/angular-ivy"; | ||
|
||
@NgModule({ | ||
// ... | ||
providers: [ | ||
{ | ||
provide: ErrorHandler, | ||
useValue: Sentry.createErrorHandler({ | ||
showDialog: true, | ||
}), | ||
}, | ||
{ | ||
provide: Sentry.TraceService, | ||
deps: [Router], | ||
}, | ||
{ | ||
provide: APP_INITIALIZER, | ||
useFactory: () => () => {}, | ||
deps: [Sentry.TraceService], | ||
multi: true, | ||
}, | ||
], | ||
// ... | ||
}) | ||
export class AppModule {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just stumbled across this. This is definitely required to set up the SDK properly in Angular apps. Otherwise the routing instrumentation doesn't work (==> no/incorrect pageload navigation transactions) and errors would only be caught by the global handlers.
src/wizard/javascript/angular/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angular/with-error-monitoring-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angular/with-error-monitoring-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angular/with-error-monitoring-performance-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angularjs/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angularjs/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angularjs/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angularjs/with-error-monitoring-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/angularjs/with-error-monitoring-performance-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/backbone/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/backbone/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/backbone/with-error-monitoring-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/svelte/with-error-monitoring-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/svelte/with-error-monitoring-performance-and-replay.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/vue/with-error-monitoring-and-performance.md
Outdated
Show resolved
Hide resolved
src/wizard/javascript/vue/with-error-monitoring-performance-and-replay.md
Outdated
Show resolved
Hide resolved
Hey @bruno-garcia - I was going to set this up to preview locally, but there's a build error. Could you get that fixed up so I can preview & review the wizard changes? LMK if you want me to look at it with you :D |
I reached out to @matejminar for help here since his team made the changes to support this new format. My PR took the |
<button | ||
type="button" | ||
onClick={() => { | ||
throw new Error("Sentry Frontend Error"); | ||
}} | ||
> | ||
Throw error | ||
</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jesse-Box thoughts on this?
You can trigger your first event from your development environment by raising an exception somewhere within your application. An example of this would be rendering a button whose `onClick` handler attempts to invoke a method that does not exist: | ||
|
||
```javascript | ||
<button onClick={() => methodDoesNotExist()}>Break the world</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jesse-Box another example
@@ -1,9 +0,0 @@ | |||
Configure your app automatically with [Sentry wizard](https://docs.sentry.io/platforms/javascript/guides/nextjs/#configure). | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AbhiPrasad this file was causing an issue in the build...I believe we do not need this. can you please confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is being used here:
wizard_setup: "./nextjs_wizard.md" |
We still need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shanamatthews build is fixed 😉 I am just waiting for @AbhiPrasad answer to my last comment before merging. |
No description provided.