Skip to content
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

Setup Application Monitoring and Error Tracking #10

Open
natterstefan opened this issue Apr 17, 2021 · 0 comments
Open

Setup Application Monitoring and Error Tracking #10

natterstefan opened this issue Apr 17, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@natterstefan
Copy link
Owner

natterstefan commented Apr 17, 2021

Feature Request

Set up Sentry or other error tracking solutions to be able to track errors during runtime.

Links

Code Snippets

# .env.local

# Sentry
# @see https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
SENTRY_DSN=""
# get the values here https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli
SENTRY_URL="https://sentry.io/"
SENTRY_ORG="your-organisation"
SENTRY_PROJECT="your-project"
# get the auth token here https://sentry.io/settings/account/api/auth-tokens/
SENTRY_AUTH_TOKEN=""
# if you get an an error that the file could not be found, note that this is a
# false-positive error
# @see https://github.com/getsentry/sentry-docs/issues/3721
# @see https://github.com/getsentry/sentry-javascript/issues/3691#issuecomment-868377000
SENTRY_SERVER_INIT_PATH=.next/server/sentry/initServerSDK.js
// next.config.js

/**
 * ATTENTION: The order matters - first `withPlugins` then `withSentryConfig`
 * @see https://github.com/getsentry/sentry-javascript/issues/3579#issuecomment-854973389
 */
const config = withPlugins([withGraphql], nextConfig)

if (nextConfig.publicRuntimeConfig.sentry.dsn) {
  module.exports = withSentryConfig(config, SentryWebpackPluginOptions)
} else {
  module.exports = config
}

If ⬆️ does not work, consider cyrilwanner/next-compose-plugins#50 (comment), getsentry/sentry-javascript#3579 (comment) or getsentry/sentry-javascript#3643 (comment) instead.

Keep an eye on

@natterstefan natterstefan added the enhancement New feature or request label Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant