Giter VIP home page Giter VIP logo

sentry-guide's Introduction

Sentry Guide

A guide on how to integrate Sentry into new projects.

Setting up the Digital Ocean Droplet

  • Install sentry-cli globally:
    • curl -sL https://sentry.io/get-cli/ | bash
  • Verify installation with sentry-cli --version.
  • Create a .sentryclirc in the home (~) directory:
    • .sentryclirc
      [auth]
      token='slack dev member for this token'

Adding configuration variables to your project

  • Create a .env file or add to an existing .env file:
    • .env
      SENTRY_AUTH_TOKEN='slack dev team member for this token'
      SENTRY_URL='https://sentry.devmountain.com/'
      SENTRY_ORG='devmountain'
      SENTRY_PROJECT='must match name on project in Sentry dashboard'
      SENTRY_ENVIRONMENT='development || staging || production'
  • Create a deployWithSentry.sh script:
    • deployWithSentry.sh (for basecamphub)
      # import environment variables
      export $(xargs < /home/devmtn/basecamp-hub/.env)
      
      # Creates a new release in sentry based off the most recent git commit sha
      sentry-cli releases new $(sentry-cli releases propose-version)
      
      # Deploy
      /home/devmtn/basecamp-hub/deploy.sh
      
      # Install Dependencies & Rebuild
      cd /home/devmtn/basecamp-hub/public && yarn install --production=false && yarn build
      
      # Define where the maps are
      cd /home/devmtn/basecamp-hub/public/dist/static/js
      
      printf "\n//# sourceMappingURL=app.js.map" >> app.js
      printf "\n//# sourceMappingURL=manifest.js.map" >> manifest.js
      printf "\n//# sourceMappingURL=vendor.js.map" >> vendor.js
      
      # Finalize the release and upload the sourcemaps
      sentry-cli releases finalize $(sentry-cli releases propose-version)
      sentry-cli releases files $(sentry-cli releases propose-version) upload-sourcemaps /home/devmtn/basecamp-hub/public/dist/static/js --ext map
      
      # Deploy the release
      sentry-cli releases deploys $(sentry-cli releases propose-version) new -e $SENTRY_ENV

Configuring your project - Front End

  • Bundle names must not have hashes in them so Sentry can successfully create source maps.
    • In Vue, this is done by going into webpack.prod.conf.js and changing the output to not use [hash] in the filename.
  • Raven must be configured before the application is initialized.
    • In Vue, this is done by going into main.js:
      • public/src/main.js
        import Raven from 'raven-js'
        import RavenVue from 'raven-js/plugins/vue'
        
        // Initialize Raven Config before Vue App
        Raven.config(process.env.RAVEN_CONFIG_URL, { environment: process.env.NODE_ENV })
          .addPlugin(RavenVue, Vue)
          .install()

sentry-guide's People

Contributors

devlemire avatar steven-isbell avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.