> For the complete documentation index, see [llms.txt](https://docs.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.ai/configuration-guide/monitoring/limits.md).

# Limits

Configure governor limit monitoring to detect spikes and threshold breaches.

Governor Limits Monitoring tracks your Salesforce org's system limits — API calls, storage, scratch orgs, and other platform limits exposed via the [Limits REST API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm). Pharos periodically captures limit snapshots and evaluates monitoring rules against the data, creating Event records when a rule fires.

This is separate from [log monitoring rules](https://docs.pharos.ai/configuration-guide/monitoring/logs.md), which analyze error volume. Limits monitoring focuses on **platform resource consumption** — helping you catch capacity problems before they cause failures.

***

## Accessing Governor Limits Monitoring

**Navigate:** Pharos App → **Pharos Admin** → **Monitoring** → **Governor Limits Monitoring**

Before configuration, the page shows the **Enable Limits Monitoring** toggle in the off state:

![Governor Limits Monitoring — disabled state with snapshot interval](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-41b8039f97a2ef0c2ee0ccd2aa6b8f33953fb083%2Flimits-disabled.png?alt=media)

***

## Enabling Limits Monitoring

Before creating rules, enable limit capture:

![Enable Limits Monitoring — snapshot interval setting](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-9e38309b2df6ea463935c8d9573285de9fe5429c%2Flimits-snapshot-interval.png?alt=media)

1. Turn the **Enable Limits Monitoring** toggle **on**
2. Set the **Limits Snapshot Interval (hours)** — how frequently Pharos captures a snapshot of your org's limits (e.g., every 2 hours)
3. Once enabled, the system begins capturing snapshots at the specified interval and evaluates all active rules against each snapshot

{% hint style="info" %}
The snapshot interval determines how granular your limit history is. A 2-hour interval is a good default — frequent enough to catch trends, infrequent enough to avoid unnecessary overhead.
{% endhint %}

***

## Rule Types

Limits monitoring supports two rule types:

### Spike

> *Monitor sudden bursts in limit consumption based on a defined percentage and time interval. Use it to detect unexpected spikes in usage that may require immediate attention.*

A Spike rule fires when limit usage **increases sharply** within the time interval. The threshold is a percentage value — if usage jumps by that percentage or more within the interval, the rule triggers.

**Best for:** Sudden API consumption surges, unexpected storage growth, runaway processes consuming resources.

![Spike — Limit Usage (%) spikes above Threshold within Interval](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-cfc1c323e934d29515fd55b741e83f7fd12fbf06%2Flimits-spike-diagram.png?alt=media)

### Threshold

> *Monitor when limit consumption crosses a defined percentage. Use it to detect when usage reaches a level that may require attention.*

A Threshold rule fires when the **absolute usage** of a limit crosses the specified percentage. Unlike Spike (which measures change), Threshold measures the current level.

**Best for:** Approaching capacity limits, storage nearing maximum, API call quotas running low.

![Threshold — Limit Usage (%) steadily increasing and crossing the Threshold line](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-c320571c02a91b93465a8597823909b4bd08f51f%2Flimits-threshold-diagram.png?alt=media)

***

## Creating a Limit Monitoring Rule

Click **Add New Rule** to open the rule form:

![Limit monitoring rule form — Spike type selected for Active Scratch Orgs](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-b2e6b585608c9d4e0279e6f00aa98ec242608aed%2Flimits-rule-spike.png?alt=media)

The right-hand navigation shows all sections: **Rule Details**, **Rule Type**, **Threshold**, **Time Interval**, and **Notifications**.

### Rule Details

Select the **Limit** to monitor from the dropdown. This is the specific Salesforce governor limit you want to track (e.g., Active Scratch Orgs, API Requests, Data Storage, etc.). The list is populated from your org's available limits.

### Rule Type

Choose **Spike** or **Threshold**:

| Type          | Threshold Value means...                                           | Time Interval                                                              |
| ------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| **Spike**     | Percentage *increase* within the interval that constitutes a spike | Required — defines the window for measuring the spike                      |
| **Threshold** | Absolute percentage of the limit at which to alert                 | Not applicable — triggers whenever a snapshot shows usage above this level |

### Threshold

Enter **Value (%)** — the percentage that triggers the rule.

* For **Spike**: this is the percentage *increase* that constitutes a spike (e.g., 10 = alert if usage jumps by 10% or more within the interval)
* For **Threshold**: this is the absolute usage level (e.g., 80 = alert when the limit is 80% consumed)

### Time Interval

*(Spike rules only)* Select the **Interval** — the time window over which to measure the spike (e.g., 1 day, 8 hours). The interval is applied to calculate the percentage change between snapshots.

### Notifications

Same as log monitoring rules — configure Email, Slack, MS Teams, Jira, or PagerDuty notifications. Click **Add New** or **Add Existing**. Multiple notifications are supported.

When a limit monitoring rule fires, it creates an **Event** record (the same Event object used by log monitoring rules), which you can view in the Pharos app → **Events** tab.

***

## Practical Examples

| Rule              | Type      | Limit               | Value | Interval | Purpose                                  |
| ----------------- | --------- | ------------------- | ----- | -------- | ---------------------------------------- |
| API quota warning | Threshold | API Requests        | 80%   | —        | Alert before hitting the daily API limit |
| Storage capacity  | Threshold | Data Storage        | 90%   | —        | Prevent storage-related failures         |
| API spike         | Spike     | API Requests        | 20%   | 1 day    | Detect abnormal API consumption surges   |
| Scratch org spike | Spike     | Active Scratch Orgs | 10%   | 1 day    | Detect unexpected scratch org creation   |

***

## Troubleshooting

| Issue                  | Cause                                 | Resolution                                                      |
| ---------------------- | ------------------------------------- | --------------------------------------------------------------- |
| No limit data captured | Limits Monitoring not enabled         | Turn on the toggle and set the snapshot interval                |
| Rule never fires       | Threshold too high or spike too large | Lower the percentage value                                      |
| Too many events        | Threshold too low                     | Raise the percentage; consider longer intervals for Spike rules |
| Stale data             | Snapshot interval too long            | Reduce the interval (e.g., from 4 hours to 2 hours)             |

***

## Related

* [Monitoring Rules (Logs)](https://docs.pharos.ai/configuration-guide/monitoring/logs.md) — Log-based spike, impact, and frequency monitoring
* [Events](https://docs.pharos.ai/configuration-guide/monitoring/events.md) — Salesforce Event Monitoring log capture
* [Salesforce Limits REST API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm) — The underlying API Pharos queries for limit snapshots
