How to create a metric alert in Sentry

Create a metric alert in Sentry that watches Number of Errors on your javascript project and raises an issue when the count passes 50 in one hour.

Quick answer

To create a metric alert in Sentry, open Monitors, choose the Metric type, and continue to the setup form. Select your project, keep the Number of Errors metric, and set the high priority threshold above 50 with a one hour interval. Name the monitor, then click Create Monitor to save it and review its details.

Steps at a glance

  1. Open the Project menu on the new metric monitor form
  2. Select the javascript project
  3. Keep the Number of Errors metric
  4. Set the High priority threshold to 50
  5. Click the monitor name and rename it
  6. Click Create Monitor
  7. Check the new monitor's details

Interactive demo

Loading demo…

Summary

A metric alert watches a number, such as how many errors your project logs per hour, and raises an issue when it crosses a limit you set. It catches sudden spikes that a single issue alert would not show on its own.

Step-by-step guide

  1. Step 1

    Choose the project

    On the new metric monitor form, find section 1, Choose the Project and Environment. Click the Select Project menu to open the list of projects. The form starts with a default project selected, so you need to switch it.

  2. Step 2

    Select the javascript project

    Under My Projects, click javascript. The preview chart above the form updates to show the error volume for that project.

  3. Step 3

    Keep the Number of Errors metric

    Section 2, Choose Your Metric, already shows Number of Errors. Leave it as it is. In section 3, Customize Metric, the Dataset is Errors and the Interval is 1 hour, which matches an hourly error count.

  4. Step 4

    Set the threshold to 50

    In section 4, Issue Detection, keep Threshold selected. Next to High priority, leave the direction on Above and type 50 in the High threshold field. The monitor now creates an issue when more than 50 errors arrive in an hour.

  5. Step 5

    Click the monitor name to rename it

    The header shows a generated name based on your settings. Click it to edit the text, type a name your team will recognize, and press Enter to confirm.

  6. Step 6

    Create the monitor

    Click Create Monitor at the bottom right. Sentry saves the monitor and shows a Monitor created message.

  7. Step 7

    Confirm the new monitor

    The monitor page opens with your new name in the header. Check the Detect section for the Errors dataset, the 1 hour interval and the static threshold of Above 50, and look at Connected Alerts to see who gets notified.

Why this matters

You ship a release and want to know right away if errors surge. A metric alert on your project's error count flags the spike within the hour, so you can investigate before customers start reporting problems.

Frequently asked questions

  • What does the Interval setting control?

    It sets the time window Sentry uses when it counts errors. This guide keeps the 1 hour interval, so the threshold applies to the count over each hour.

  • Can I change the name later?

    The monitor page includes an Edit button, so you can reopen the settings after you create it.

Create interactive demos like this one — free, no coding required.

Start for free →