@upstash/ratelimit
Analytics
You can enable analytics to get a better understanding of how your ratelimiting
is performing. This is done by setting analytics: true
in the options.
All data is stored in the same Redis database and writing analytics uses 1
command per .limit
invocation.
const ratelimit = new Ratelimit({
redis: Redis.fromEnv(),
limiter: Ratelimit.tokenBucket(5, "10 s", 10),
analytics: true, // <- Enable analytics
});
Go to the Ratelimit Dashboard and select the database you are using.
If you are using a custom prefix, you need to use the same in the dashboard’s top right corner.

Was this page helpful?