How to set a DSN rate limit in Sentry

Learn how to set a DSN rate limit in Sentry by capping the errors a client key accepts per time window, so a noisy project cannot flood your quota.

Quick answer

Open your project's Client Keys (DSN) page, click Configure on the key, then fill in the Count field under Rate Limits with the maximum number of errors to accept. Choose a Time Window, and click Save. Sentry then limits how many errors that key accepts within the window.

Steps at a glance

  1. Open Client Keys (DSN) in your project settings
  2. Click Configure on the key you want to limit
  3. Find Rate Limits on the Key Details page
  4. Enter a maximum error number in Count
  5. Set the Time Window for that count
  6. Click Save to apply the rate limit

Interactive demo

Loading demo…

Summary

A DSN rate limit caps how many errors one client key accepts in a chosen time window. It protects your quota from a noisy release or a runaway loop, because extra events are dropped instead of processed.

Step-by-step guide

  1. Step 1

    Open Client Keys (DSN)

    Open the settings for your project and look in the SDK Setup group of the secondary navigation. Click Client Keys (DSN) to see the keys that your project uses to send events.

  2. Step 2

    Click Configure on the key

    Find the key you want to limit, here the one named Default. Click Configure next to it to open the Key Details page, which shows the key usage chart and its settings.

  3. Step 3

    Click the Count field

    Scroll down to the Rate Limits section. Click Count and enter the maximum number of errors the key should accept. Below it, the Time Window slider sets the period that this count applies to, such as 1 minute.

  4. Step 4

    Save the rate limit

    Check that Count and Time Window show the values you want, then click Save. The limit applies to events sent with this key from then on.

Why this matters

You shipped a release and one broken loop is sending thousands of identical errors. Setting a rate limit on the key keeps your quota safe and your issue feed readable, while the rest of your project keeps reporting normally.

Frequently asked questions

  • What does Time Window control?

    Time Window is the period in which the Count limit applies. In this capture it was set to 1 minute, and the slider starts at None.

  • Does the rate limit apply to the whole project?

    It is set on a single client key from the Key Details page, so it applies to events sent with that key.

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

Start for free →