If you're setting up Plio for staging or production, you may also wish to capture errors faced by users in real-time. For that purpose, Plio uses Sentry.io for real-time error monitoring and reporting.
- Create an account at Sentry.
- Set up your organization.
- Create a new VueJS project. Name it
plio-frontend
.
- Set up env variable for
SENTRY_DSN
. You can get the value of DSN for your projects fromProject Settings > SDK Setup > Client Keys (DSN)
- Make sure your
NODE_ENV
is either 'staging' or 'production'. - Test your set up by triggering an error - add the following line in your code somewhere:
throw "Deliberate Error!";
- Once you invoke the error trigger, you should now see the error at your Sentry dashboard as well from the
Issues
tab.
By default, Sentry sends error reports to your inbox. However, you may prefer other channels to receive error notifications.
At Plio, we use Discord to receive real-time alerts using Sentry Webhooks. If you're also using Discord, or a different tool that supports webhooks, follow the steps below to start receiving alerts:
- Create a new channel at Discord where you want to receive the alerts. Then, enable the webhook and copy webhook url.
Channel settings > Integrations > Webhook
- Create a SentryDiscord webhook.
- Visit this page at SentryDiscord.dev.
- Paste the Discord webhook that you copied in the first step.
- Click on create.
- You will receive a new webhook. Copy and store it somewhere. We'll use it later.
- Go to
Integrations
for your organization fromSettings > Integrations
- Search for
Webhooks
and click onAdd to project
. - Select your project.
- Enter the SentryDiscord webhook url from step 2 inside the
Callback URLs
textbox. - Click
Save changes
. - Click
Enable Plugin
. - Next, go to
Alerts
. By default you may see an alert namedSend a notification for new issues
. If yes, you can skip the create alert step below and got to edit existing alert. - Create a new Alert
- Click on
Create Alert Rule
. - In the select alert section, select
Issues
inside theErrors
heading. - Click on
Set Conditions
. Environment
to be "All Environments".- Set the Alert name to "Send a notification for new issues"
- Move to Set Conditions section.
- For
WHEN
, select "A new issue is created". - For
IF
, leave it as default (no filters). - For
THEN
, add two options.Send a notification
and selectIssue Owners
.Send a notification via an integration
and selectWebHooks
.
- Set action interval as per your needs.
- Click on
- Edit existing alert - use this if you want to edit existing alert
- Move to Set Conditions section.
- For
THEN
, make sure you have theSend a notification via an integration
option configured withWebHooks
.
- All set. Trigger an error in your app and you should see the error coming to your Discord channel!