-
Be sure to have node, NVM, and git installed.
-
Fork this repository and clone. Set node version as specified:
git clone https://github.com/<your_fork>/ng-conf-sample-app
nvm use
- Then install with
npm install
- Then build and run server with
npm run deploy
-
Verify web server is running properly and app can be loaded (go to http://localhost:5000 in the browser and trigger errors)
-
You should be set for the workshop, where you will add Sentry into this angular application to monitor errors.
-
Go to https://sentry.io/signup + 'create your account'.
-
Follow onboarding steps (select angular project) and instrument code as specified.
-
Then build and run server with
npm run deploy
- Go to http://localhost:5000 and trigger errors. The Sentry onboarding (part-3) should note that event was successfully. Follow link to event in Sentry.io.
- Specify
release
in Sentry SDK
Sentry.init({
...,
release: environment.release
})
- Install sentry-cli to upload sourcemaps
npm install --save-dev @sentry/cli
- Create production bundles and sourcemaps
# In angular.json, this is already done. Checkout source maps at dist/
"sourceMap": true
-
In Makefile, remove placeholder
setup_release
and uncomment actual one (which is callingupload_sourcemaps
). -
Create 'New Internal Integration' to obtain AUTH_TOKEN.
Organization Settings -> Developer Settings -> 'New Internal Integration'
NOTE:
Release: Admin
+Organization: Read & Write
permissions are needed
- Specify SENTRY_AUTH_TOKEN as environment variable
export SENTRY_AUTH_TOKEN=<YOUR_AUTH_TOKEN>
-
Specify
SENTRY_ORG
andSENTRY_PROJECT
accordingly in Makefile -
Run build/deploy:
npm run deploy
Verify Source Maps are uploaded
Project Settings -> Source Maps
- Trigger new errors (http://localhost:5000) and verify filename/stacktrace
-
Head over to
Performance
on left hand side -
Drill down on transaction to view distributed trace
- Enable Business Trial (to enable integrations + full feature set)
Organization Settings -> Subscription -> 'Activate Your Trial'
- Add Slack integration
Organization Settings -> Integrations -> Slack
-
Specify in alert rule
-
Trigger error and verify alert
- Add GitHub integration
Organization Settings -> Integrations -> GitHub
-
Add
associate_commits
tosetup_release
in Makefile -
Run build/deploy + trigger errors
npm run deploy
Go to http://localhost:5000 + click on errors
- Pull up error/issue on Sentry. You should see 'Suspect Commit' and 'Suggested Assignee'
In case you get lost, the working code can be found in the final-state
branch (https://github.com/ndmanvar/ng-conf-2020-sentry-workshop/tree/final-code)