-
Notifications
You must be signed in to change notification settings - Fork 63
Update Sentry version and turn it on only for production #450
Conversation
nuxt.config.js
Outdated
@@ -204,6 +204,7 @@ export default { | |||
dsn: | |||
process.env.SENTRY_DSN || | |||
'https://3f3e05dbe6994c318d1bf1c8bfcf71a1@o288582.ingest.sentry.io/1525413', | |||
disabled: process.env.NODE_ENV !== 'production', |
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.
Nice!
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 think we'll actually want to make this explicitly disabled locally somehow, because soon we'll have cloud staging and production environments and we'll want to have Sentry running on both.
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.
Can we have a separate var like ENABLE_SENTRY
? It'll allow Sentry to be enabled or disabled.
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.
Looks great, let's just make sure Sentry will still run on our cloud staging environment too.
nuxt.config.js
Outdated
@@ -204,6 +204,7 @@ export default { | |||
dsn: | |||
process.env.SENTRY_DSN || | |||
'https://3f3e05dbe6994c318d1bf1c8bfcf71a1@o288582.ingest.sentry.io/1525413', | |||
disabled: process.env.NODE_ENV !== 'production', |
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 think we'll actually want to make this explicitly disabled locally somehow, because soon we'll have cloud staging and production environments and we'll want to have Sentry running on both.
Why do we want Sentry in staging? |
My thinking was if there's errors getting logged while we're testing staging that we don't notice, that Sentry could help make those more visible. Just more assurance against bugs. I'd frankly be happy to run it locally, too, but for the sake of devex and nuxt initialization speed (it can make a difference of a few seconds) I think it's fine to omit. |
If we're going to run it in staging should we make the sentry URL configurable and have a separate environment for staging? Or is there a way to partition the sentry dashboard by the source's host or something like that? |
Sentry has a concept of environments1 that by default uses Footnotes |
@zackkrida , I have currently set the Sentry disabled when NODE_ENV is |
Co-authored-by: Zack Krida <zackkrida@pm.me>
Co-authored-by: Zack Krida <zackkrida@pm.me>
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.
🎉 🤠
Fixes
Fixes #446 by @zackkrida
Description
This PR updates the
@nuxtjs/sentry
package version to the most recent one,5.1.5
, which uses Sentry SDK version6.14.1
, not the most recent6.15.0
. It also loads Sentry only on production builds to make the development environment faster.Testing Instructions
I only ran:
npm ci
npm run dev
npm run build
,npm run start
. Locally, this raises a CORS error.After deploy, we can see if there are any problems (which there shouldn't be).
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin