Skip to content

Commit

Permalink
docs: notification rate limiting
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Sep 2, 2024
1 parent 1ce4130 commit 310fe95
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mission-control/docs/notifications/concepts/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Concepts
sidebar_position: 2
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
40 changes: 40 additions & 0 deletions mission-control/docs/notifications/concepts/rate-limiting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Rate Limiting
---

To prevent overwhelming users with excessive notifications, Mission Control implements a rate limiting mechanism.

We use a sliding window rate limiter that restricts the total number of notifications sent within a specified time period.

Check warning on line 7 in mission-control/docs/notifications/concepts/rate-limiting.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/notifications/concepts/rate-limiting.mdx#L7

[alex.ProfanityUnlikely] Be careful with 'period', it's profane in some cases.
Raw output
{"message": "[alex.ProfanityUnlikely] Be careful with 'period', it's profane in some cases.", "location": {"path": "mission-control/docs/notifications/concepts/rate-limiting.mdx", "range": {"start": {"line": 7, "column": 116}}}, "severity": "WARNING"}

:::info
The rate limit is applied individually to each notification.
:::

:::caution Rate Limited Notifications
When a notification exceeds the rate limit, it is dropped and not delivered to the user.
:::

## Default Configuration

The following table outlines the default rate limiting parameters:

| Property | Value |
|----------------------------------|----------|
| Maximum number of notifications allowed per window | 50 |
| Time period for the sliding window | 4 hours |

Check warning on line 24 in mission-control/docs/notifications/concepts/rate-limiting.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/notifications/concepts/rate-limiting.mdx#L24

[alex.ProfanityUnlikely] Be careful with 'period', it's profane in some cases.
Raw output
{"message": "[alex.ProfanityUnlikely] Be careful with 'period', it's profane in some cases.", "location": {"path": "mission-control/docs/notifications/concepts/rate-limiting.mdx", "range": {"start": {"line": 24, "column": 8}}}, "severity": "WARNING"}

## Customizing Rate Limiting Parameters

You can override the default settings by adjusting the following properties:

- `notifications.max.count`: Sets the maximum number of notifications allowed within the window
- `notifications.max.window`: Defines the duration of the sliding window (in hours)

### Example Configuration

To allow a maximum of 100 notifications in a 6 hour window:

```
notifications.max.count=100
notifications.max.window=6h
```

0 comments on commit 310fe95

Please sign in to comment.