Git Product home page Git Product logo

Comments (3)

bajajcodes avatar bajajcodes commented on July 29, 2024

Hey @pallabez please assign this issue to me.

from website-goals.

bajajcodes avatar bajajcodes commented on July 29, 2024

What is Sentry

Sentry is a tool to track errors, capture crashes and monitor performance.
Sentry doesn't impact a website's performance.

Setup Project in Sentry

  • Visit sentry.io, create project and copy DSN

Installation and Minimum Configuring

// Install sentry in nuxt
yarn add @nuxtjs/sentry

// add to nuxt.config.js
  modules: [
    '@nuxtjs/sentry'
  ],

// config sentry object in nuxt.config.js
  sentry: {
    dsn: process.env.SENTRY_DSN || '',
  }

// create .env add sentry DSN
SENTRY_DSN = <value>
# create .sentryclirc file and add the following
[defaults]
org = <your_sentry_org> # real-dev-squad
project = <your_sentry_project> # website-goal
url = <your_sentry_url> # https://real-dev-squad.sentry.io/
More on Installation Methods (in order of preference by sentry)
  • Using NPM or YARN (bundle with code)
  • Lazy Loading CDN (lazy load after app js or when an error happens)
  • Using CDN (PS: not a preferred method)
  • Check More From Here

Add More Options To Sentry Configuration BLOCKER: Unable to upload source maps

  • Enabling Source Maps
  • Using Sentry in PROD Environment Only

References

Checklist

  • Check Configuring tracing sampling rate at runtime
  • Check to reduce the default tracing sampling rate value
  • Check Sentry Usage to catch errors manually (By default, Sentry catches automatically): Sentry NuxtJs Module Usage Guide
  • Lazy Loading Sentry
  • Load Sentry in Production Environment Only
  • Source Map Enabled
  • Explore More Options for RDS Wide Configuration

from website-goals.

bajajcodes avatar bajajcodes commented on July 29, 2024

update: Trying to set up Sentry as a Vue-based client-only plugin.

  • [15-02-23] Created a client side plugin for sentry, but config missing error. Will connect with AO @pallabez to fix this.
// plugins/sentry.js
import * as Sentry from '@sentry/vue'
import { Integrations } from '@sentry/tracing'

export default (nuxtApp, inject) => {
  const { app } = nuxtApp
  app.config = app.$config
  Sentry.init({
    app,
    dsn: process.env.SENTRY_DSN,
    integrations: [new Integrations.BrowserTracing()],
    tracesSampleRate: 1.0,
    // Set up source maps to help with debugging
    beforeSend (event, hint) {
      if (hint.originalException && hint.originalException.stack) {
        const stacktrace =
          hint.originalException.stacktrace ||
          (hint.originalException.exception &&
            hint.originalException.exception.values[0].stacktrace)
        if (stacktrace) {
          event.request = {
            url: window.location.href,
            headers: {
              'User-Agent': navigator.userAgent
            }
          }
          event.stacktrace = stacktrace
        }
      }
      return event
    }
  })
  inject('sentry', Sentry)
}

Nuxt2 Plugin Doc

from website-goals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.