> 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/platform-overview/pharos-platform-architecture/monitoring/governor-limits.md).

# Governor Limits

Monitor governor limits with spike and threshold rules and understand snapshot logs.

Governor Limits Monitoring in Pharos tracks Salesforce system limits—API calls, storage, CPU time, heap size, and others—and alerts you when usage exceeds thresholds or spikes unexpectedly. This helps you avoid hitting limits before they impact users.

***

## Why Monitor Governor Limits

Salesforce enforces strict limits on resource consumption. When limits are exceeded, transactions fail—often with cryptic errors. Monitoring limits proactively lets you:

* **Detect trends** — Identify when usage is approaching limits before failures occur
* **Catch spikes** — Sudden increases may indicate runaways, infinite loops, or new integrations
* **Plan capacity** — Understand consumption patterns for capacity planning

***

## How It Works

1. **Enable Limits Monitoring** in Pharos Admin → Monitoring → Governor Limits
2. **Set snapshot interval** — How often Pharos captures limit usage (e.g., every 2 hours)
3. **Create rules** — Define threshold or spike rules per limit type
4. **Configure notifications** — When a rule fires, Pharos sends alerts (Slack, Teams, Email, PagerDuty)

Pharos queries Salesforce's limit API at the configured interval and stores snapshots. Rules evaluate against the latest snapshot data.

***

## Rule Types

Limits monitoring offers two rule types, and the distinction between them is *level versus change*.

**Threshold rules** watch the absolute level of consumption: fire when storage passes 80% of the org limit. They answer "are we running out?" and are the right choice for capacity planning — quotas filling up, storage approaching its ceiling, API calls running down.

**Spike rules** watch the rate of change: fire when API consumption jumps by 50% within a window. They answer "did something just change?" and catch runaway processes or a newly deployed integration consuming far more than its predecessor — often well before the absolute level would trip a threshold rule.

The two are complements rather than alternatives. A threshold rule alone won't warn you about a process that doubled its consumption overnight but still sits at 40% of the limit; a spike rule alone won't warn you about steady growth that quietly approaches the ceiling.

For the rule form and its settings, see [Limits Monitoring](https://docs.pharos.ai/configuration-guide/monitoring/limits.md#rule-types).

***

## Example Limits

| Limit Type              | Typical Use                        |
| ----------------------- | ---------------------------------- |
| **API Calls**           | Monitor daily API consumption      |
| **Storage**             | Alert when approaching storage cap |
| **CPU Time**            | Detect CPU-intensive operations    |
| **Heap Size**           | Identify memory-heavy transactions |
| **Active Scratch Orgs** | DevOps orgs with many scratch orgs |

***

## Snapshot Logs

Pharos captures limit snapshots at the configured interval. These snapshots are stored as records you can query and report on—providing historical visibility into limit trends even when rules don't fire.

***

## Related

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>⚡ Configuration Guide: Limits</strong></td><td>Admin configuration steps</td><td><a href="https://docs.pharos.ai/configuration-guide/monitoring/limits.md">Limits</a></td></tr><tr><td><strong>📈 Log Monitoring</strong></td><td>Log-based monitoring</td><td><a href="https://docs.pharos.ai/platform-overview/pharos-platform-architecture/monitoring/log-monitoring.md">Log Monitoring</a></td></tr><tr><td><strong>📊 Event Monitoring</strong></td><td>Event log capture</td><td><a href="https://docs.pharos.ai/platform-overview/pharos-platform-architecture/monitoring/event-monitoring.md">Event Monitoring</a></td></tr></tbody></table>
