Use this skill when an org needs proactive, automated visibility into its consumption of Salesforce platform limits. Unlike per-transaction governor limits that are enforced inline during code execution, org-level limits are shared ceilings that accumulate over time -- daily API calls, data storage, file storage, custom object counts, platform event delivery allocations, and more. When these limits are exhausted, the impact is org-wide: all integrations fail, all users are blocked from creating records, or platform events are silently dropped. The correct response is not reactive firefighting but proactive monitoring with automated threshold alerts.
Before Starting
- Which limits matter most? Not every org needs to monitor every limit. Identify the limits that are most likely to be exhausted given the org's usage pattern -- integration-heavy orgs should monitor API calls; high-growth orgs should monitor storage; event-driven architectures should monitor platform event delivery allocations.
- What is the current consumption baseline? Before setting thresholds, establish what "normal" looks like. A single day's snapshot is not enough -- collect at least two weeks of data to identify peaks and trends.
- What notification channels are available? Email is the simplest but most easily ignored. Platform Events can drive real-time LWC dashboards. Custom Notifications appear in-app. Outbound Messages or callouts can reach Slack or PagerDuty.
Core Concepts
Three Monitoring Surfaces
Salesforce exposes org-level limit data through three distinct surfaces, each with different strengths:
Surface 1: Apex OrgLimits Class
The System.OrgLimits class (available since API v41.0) provides a Map<String, System.OrgLimit> via OrgLimits.getAll(). Each OrgLimit instance exposes .getName(), .getLimit(), and .getValue() (current consumption). This is the best surface for scheduled Apex-based monitoring because it runs inside the org without consuming an API call.
Key characteristics:
- Returns a curated subset of limits, not every limit the REST resource exposes.
- Does not consume an API call (it is native Apex, not a callout).
- Available in all Apex execution contexts (trigger, batch, queueable, scheduled).
- The map keys are string names like
DailyApiRequests, DataStorageMB, FileStorageMB, DailyAsyncApexExecutions, DailyBulkApiRequests, DailyStreamingApiEvents, HourlyPublishedPlatformEvents, and others.
Surface 2: REST API Limits Resource
GET /services/data/vXX.0/limits returns a JSON object with every org limit, including limits not available through the Apex class. Each entry contains Max and Remaining values.
Key characteristics:
- Most comprehensive surface -- exposes limits that OrgLimits.getAll() does not.
- Consumes one API call per invocation (factor this into API budget calculations).
- Ideal for external monitoring tools, middleware health checks, or CI/CD pre-deployment validation.
- Response payload is a flat JSON object with limit names as keys.
Surface 3: Setup -- Company Information
The Setup > Company Information page displays storage usage, API usage (last 24 hours), and feature limits in the UI. This is the only monitoring surface available to administrators without developer tooling.
Key characteristics:
- No programmatic access -- manual inspection only.
- Useful for one-time audits but not for proactive alerting.
- Shows a rolling 24-hour window for API usage.
- Storage breakdown shows data storage, file storage, and big object storage separately.
Threshold Alerting Architecture
The recommended architecture for proactive limit monitoring follows a simple pattern:
- Scheduled Apex runs on a cron schedule (hourly or every 4 hours).
- The job calls
OrgLimits.getAll() and compares each limit's .getValue() against .getLimit().
- When consumption crosses a configured threshold (e.g., 70% warning, 90% critical), the job fires an alert through one or more channels.
- Alert channels include:
Messaging.SingleEmailMessage for email, Platform Event publish for real-time dashboard updates, Messaging.CustomNotification for in-app bell notifications, or an HTTP callout to an external incident management system.
Custom Metadata for Threshold Configuration
Store monitoring thresholds in Custom Metadata Type records rather than hard-coding them. This allows administrators to adjust thresholds without code changes and supports per-limit configuration:
Limit_Monitor_Config__mdt with fields: Limit_Name__c (text, matches the OrgLimit key), Warning_Threshold__c (percent, e.g., 70), Critical_Threshold__c (percent, e.g., 90), Enabled__c (checkbox), Notification_Channel__c (picklist: Email / Platform Event / Custom Notification / External).
Distinguishing From Related Skills
| Concern |
Correct Skill |
| Designing for governor limit headroom in new builds |
limits-and-scalability-planning |
| Throttling API consumers via Connected App policies |
api-security-and-rate-limiting |
| Optimizing individual Apex transactions for CPU/heap |
apex-cpu-and-heap-optimization |
| Monitoring org-wide limit consumption and alerting |
org-limits-monitoring (this skill) |
Recommended Workflow
Identify critical limits. Review the org's integration landscape, storage trajectory, and automation density. Select the 5-10 limits most likely to be exhausted. Common high-priority limits: DailyApiRequests, DataStorageMB, FileStorageMB, DailyBulkApiRequests, HourlyPublishedPlatformEvents, DailyAsyncApexExecutions.
Establish baselines. Run OrgLimits.getAll() or GET /services/data/vXX.0/limits daily for two weeks. Record peak consumption values. Use these peaks to set meaningful thresholds that avoid false alarms.
Design the monitoring job. Create a Scheduled Apex class that reads limit values from OrgLimits.getAll(), compares them against thresholds stored in Custom Metadata, and dispatches alerts when thresholds are crossed. Schedule the job at an appropriate frequency (hourly for API-heavy orgs, every 4 hours for storage-focused monitoring).
Configure alert routing. Map each limit to a notification channel. API limit breaches may need to reach the integration team via Slack webhook. Storage warnings may need to reach the data team via email. Critical alerts for any limit should page the platform team.
Build visibility. Create a Lightning Dashboard or LWC component that displays current limit consumption as gauges or progress bars. If the monitoring job publishes Platform Events, the dashboard can update in near-real-time without polling.
Test with realistic load. In a full sandbox, simulate high-consumption scenarios (e.g., run a bulk data load that consumes 80% of daily API calls) and verify that alerts fire correctly and reach the intended audience.
Operationalize. Add the monitoring job to the org's runbook. Document the escalation path for each alert severity. Review thresholds quarterly as org usage patterns evolve.
Modes of Engagement
Mode 1: Greenfield Monitoring Setup
The org has no limit monitoring in place. Start from Step 1 of the Recommended Workflow. Deliver a complete monitoring solution including Scheduled Apex, Custom Metadata configuration, alert routing, and a visibility dashboard.
Mode 2: Incident Response -- Limit Exhausted
A limit has already been breached. Start by identifying which limit was exhausted using GET /services/data/vXX.0/limits or Setup > Company Information. Determine the root cause (unexpected integration spike, data load, runaway automation). Implement emergency mitigation (disable the offending integration, archive data, increase allocation if contractually possible). Then proceed to Mode 1 to prevent recurrence.
Mode 3: Existing Monitoring Enhancement
The org has basic monitoring (e.g., a weekly manual check or a simple email alert) but needs more sophistication. Assess the current monitoring coverage, identify blind spots (limits not being tracked, thresholds too high or too low, alert fatigue from false positives), and enhance the solution incrementally.
Key Limit Categories
API Consumption Limits
| Limit |
Scope |
How to Check |
| DailyApiRequests |
Per 24-hour rolling window |
OrgLimits / REST /limits |
| DailyBulkApiRequests |
Per 24-hour rolling window |
OrgLimits / REST /limits |
| DailyBulkV2QueryJobs |
Per 24-hour rolling window |
REST /limits |
| DailyBulkV2QueryFileStorageMB |
Per 24-hour rolling window |
REST /limits |
Storage Limits
| Limit |
Scope |
How to Check |
| DataStorageMB |
Org-wide |
OrgLimits / REST /limits / Setup |
| FileStorageMB |
Org-wide |
OrgLimits / REST /limits / Setup |
Platform Event Limits
| Limit |
Scope |
How to Check |
| HourlyPublishedPlatformEvents |
Per clock hour |
OrgLimits / REST /limits |
| HourlyPublishedStandardVolumePlatformEvents |
Per clock hour |
REST /limits |
| DailyStandardVolumePlatformEvents |
Per 24-hour rolling window |
REST /limits |
Async Processing Limits
| Limit |
Scope |
How to Check |
| DailyAsyncApexExecutions |
Per 24-hour rolling window |
OrgLimits / REST /limits |
| ConcurrentAsyncGetReportInstances |
Concurrent |
REST /limits |
Official Sources Used
- Apex Reference Guide -- OrgLimits class and OrgLimit methods
- REST API Developer Guide -- Limits resource (
/services/data/vXX.0/limits)
- Salesforce Help -- Monitor API Usage and Limits
- Salesforce Well-Architected Overview -- Operational Excellence pillar
1---
2name: org-limits-monitoring
3description: "Use when designing or implementing proactive monitoring of Salesforce org-level limits such as API call consumption, storage usage, custom object counts, or platform event allocations. Trigger phrases: 'how do I monitor org limits programmatically', 'set up alerts before we hit API limits', 'REST Limits resource usage', 'OrgLimits.getAll() in Apex', 'scheduled limit checks', 'proactive limit threshold alerting', 'Company Information limits dashboard', 'we keep getting surprised by limit breaches in production'. NOT for per-transaction governor limit planning (use limits-and-scalability-planning). NOT for Connected App API throttling or rate limiting policies (use api-security-and-rate-limiting). NOT for individual Apex code optimization against transaction limits (use apex-cpu-and-heap-optimization)."
4category: architect
5salesforce-version: "Spring '25+"
6well-architected-pillars:
7 - Operational Excellence
8 - Reliability
9 - Security
10tags:
11 - org-limits
12 - api-usage
13 - monitoring
14 - platform-events
15 - storage
16 - scheduled-apex
17 - alerting
18 - limits-api
19 - observability
20 - proactive-monitoring
21triggers:
22 - "we need to know when we are approaching org-level limits before they cause failures"
23 - "how do I programmatically check API call consumption and remaining daily allowance"
24 - "set up automated alerts when storage or API usage crosses a warning threshold"
25 - "our integrations failed because we exhausted the daily API limit overnight"
26 - "what is the difference between OrgLimits.getAll() and the REST Limits resource"
27inputs:
28 - "Org edition and license type (determines base limit allocations)"
29 - "List of limits to monitor (API calls, storage, custom objects, platform events, etc.)"
30 - "Desired alert thresholds (e.g., warn at 70%, critical at 90%)"
31 - "Notification channels (email, Platform Event, Slack webhook, custom notification)"
32 - "Monitoring frequency (hourly, every 4 hours, daily)"
33outputs:
34 - "Org limits monitoring architecture recommendation"
35 - "Scheduled Apex polling class for limit checks"
36 - "Threshold alerting strategy with notification routing"
37 - "Dashboard or report-based visibility approach"
38 - "Filled org-limits-monitoring-template.md"
39dependencies:
40 - limits-and-scalability-planning
41version: 1.0.0
42author: Pranav Nagrecha
43updated: 2026-04-05
44metadata:
45 source: https://skillmd.com/skills/aibot88/org-limits-monitoring
46---
47
48Use this skill when an org needs proactive, automated visibility into its consumption of Salesforce platform limits. Unlike per-transaction governor limits that are enforced inline during code execution, org-level limits are shared ceilings that accumulate over time -- daily API calls, data storage, file storage, custom object counts, platform event delivery allocations, and more. When these limits are exhausted, the impact is org-wide: all integrations fail, all users are blocked from creating records, or platform events are silently dropped. The correct response is not reactive firefighting but proactive monitoring with automated threshold alerts.
49
50---
51
52## Before Starting
53
54- **Which limits matter most?** Not every org needs to monitor every limit. Identify the limits that are most likely to be exhausted given the org's usage pattern -- integration-heavy orgs should monitor API calls; high-growth orgs should monitor storage; event-driven architectures should monitor platform event delivery allocations.
55- **What is the current consumption baseline?** Before setting thresholds, establish what "normal" looks like. A single day's snapshot is not enough -- collect at least two weeks of data to identify peaks and trends.
56- **What notification channels are available?** Email is the simplest but most easily ignored. Platform Events can drive real-time LWC dashboards. Custom Notifications appear in-app. Outbound Messages or callouts can reach Slack or PagerDuty.
57
58---
59
60## Core Concepts
61
62### Three Monitoring Surfaces
63
64Salesforce exposes org-level limit data through three distinct surfaces, each with different strengths:
65
66#### Surface 1: Apex OrgLimits Class
67
68The `System.OrgLimits` class (available since API v41.0) provides a `Map<String, System.OrgLimit>` via `OrgLimits.getAll()`. Each `OrgLimit` instance exposes `.getName()`, `.getLimit()`, and `.getValue()` (current consumption). This is the best surface for scheduled Apex-based monitoring because it runs inside the org without consuming an API call.
69
70Key characteristics:
71- Returns a curated subset of limits, not every limit the REST resource exposes.
72- Does not consume an API call (it is native Apex, not a callout).
73- Available in all Apex execution contexts (trigger, batch, queueable, scheduled).
74- The map keys are string names like `DailyApiRequests`, `DataStorageMB`, `FileStorageMB`, `DailyAsyncApexExecutions`, `DailyBulkApiRequests`, `DailyStreamingApiEvents`, `HourlyPublishedPlatformEvents`, and others.
75
76#### Surface 2: REST API Limits Resource
77
78`GET /services/data/vXX.0/limits` returns a JSON object with every org limit, including limits not available through the Apex class. Each entry contains `Max` and `Remaining` values.
79
80Key characteristics:
81- Most comprehensive surface -- exposes limits that OrgLimits.getAll() does not.
82- Consumes one API call per invocation (factor this into API budget calculations).
83- Ideal for external monitoring tools, middleware health checks, or CI/CD pre-deployment validation.
84- Response payload is a flat JSON object with limit names as keys.
85
86#### Surface 3: Setup -- Company Information
87
88The Setup > Company Information page displays storage usage, API usage (last 24 hours), and feature limits in the UI. This is the only monitoring surface available to administrators without developer tooling.
89
90Key characteristics:
91- No programmatic access -- manual inspection only.
92- Useful for one-time audits but not for proactive alerting.
93- Shows a rolling 24-hour window for API usage.
94- Storage breakdown shows data storage, file storage, and big object storage separately.
95
96### Threshold Alerting Architecture
97
98The recommended architecture for proactive limit monitoring follows a simple pattern:
99
1001. **Scheduled Apex** runs on a cron schedule (hourly or every 4 hours).
1012. The job calls `OrgLimits.getAll()` and compares each limit's `.getValue()` against `.getLimit()`.
1023. When consumption crosses a configured threshold (e.g., 70% warning, 90% critical), the job fires an alert through one or more channels.
1034. Alert channels include: `Messaging.SingleEmailMessage` for email, Platform Event publish for real-time dashboard updates, `Messaging.CustomNotification` for in-app bell notifications, or an HTTP callout to an external incident management system.
104
105### Custom Metadata for Threshold Configuration
106
107Store monitoring thresholds in Custom Metadata Type records rather than hard-coding them. This allows administrators to adjust thresholds without code changes and supports per-limit configuration:
108
109- `Limit_Monitor_Config__mdt` with fields: `Limit_Name__c` (text, matches the OrgLimit key), `Warning_Threshold__c` (percent, e.g., 70), `Critical_Threshold__c` (percent, e.g., 90), `Enabled__c` (checkbox), `Notification_Channel__c` (picklist: Email / Platform Event / Custom Notification / External).
110
111### Distinguishing From Related Skills
112
113| Concern | Correct Skill |
114|---|---|
115| Designing for governor limit headroom in new builds | limits-and-scalability-planning |
116| Throttling API consumers via Connected App policies | api-security-and-rate-limiting |
117| Optimizing individual Apex transactions for CPU/heap | apex-cpu-and-heap-optimization |
118| Monitoring org-wide limit consumption and alerting | **org-limits-monitoring** (this skill) |
119
120---
121
122## Recommended Workflow
123
1241. **Identify critical limits.** Review the org's integration landscape, storage trajectory, and automation density. Select the 5-10 limits most likely to be exhausted. Common high-priority limits: `DailyApiRequests`, `DataStorageMB`, `FileStorageMB`, `DailyBulkApiRequests`, `HourlyPublishedPlatformEvents`, `DailyAsyncApexExecutions`.
125
1262. **Establish baselines.** Run `OrgLimits.getAll()` or `GET /services/data/vXX.0/limits` daily for two weeks. Record peak consumption values. Use these peaks to set meaningful thresholds that avoid false alarms.
127
1283. **Design the monitoring job.** Create a Scheduled Apex class that reads limit values from `OrgLimits.getAll()`, compares them against thresholds stored in Custom Metadata, and dispatches alerts when thresholds are crossed. Schedule the job at an appropriate frequency (hourly for API-heavy orgs, every 4 hours for storage-focused monitoring).
129
1304. **Configure alert routing.** Map each limit to a notification channel. API limit breaches may need to reach the integration team via Slack webhook. Storage warnings may need to reach the data team via email. Critical alerts for any limit should page the platform team.
131
1325. **Build visibility.** Create a Lightning Dashboard or LWC component that displays current limit consumption as gauges or progress bars. If the monitoring job publishes Platform Events, the dashboard can update in near-real-time without polling.
133
1346. **Test with realistic load.** In a full sandbox, simulate high-consumption scenarios (e.g., run a bulk data load that consumes 80% of daily API calls) and verify that alerts fire correctly and reach the intended audience.
135
1367. **Operationalize.** Add the monitoring job to the org's runbook. Document the escalation path for each alert severity. Review thresholds quarterly as org usage patterns evolve.
137
138---
139
140## Modes of Engagement
141
142### Mode 1: Greenfield Monitoring Setup
143
144The org has no limit monitoring in place. Start from Step 1 of the Recommended Workflow. Deliver a complete monitoring solution including Scheduled Apex, Custom Metadata configuration, alert routing, and a visibility dashboard.
145
146### Mode 2: Incident Response -- Limit Exhausted
147
148A limit has already been breached. Start by identifying which limit was exhausted using `GET /services/data/vXX.0/limits` or Setup > Company Information. Determine the root cause (unexpected integration spike, data load, runaway automation). Implement emergency mitigation (disable the offending integration, archive data, increase allocation if contractually possible). Then proceed to Mode 1 to prevent recurrence.
149
150### Mode 3: Existing Monitoring Enhancement
151
152The org has basic monitoring (e.g., a weekly manual check or a simple email alert) but needs more sophistication. Assess the current monitoring coverage, identify blind spots (limits not being tracked, thresholds too high or too low, alert fatigue from false positives), and enhance the solution incrementally.
153
154---
155
156## Key Limit Categories
157
158### API Consumption Limits
159
160| Limit | Scope | How to Check |
161|---|---|---|
162| DailyApiRequests | Per 24-hour rolling window | OrgLimits / REST /limits |
163| DailyBulkApiRequests | Per 24-hour rolling window | OrgLimits / REST /limits |
164| DailyBulkV2QueryJobs | Per 24-hour rolling window | REST /limits |
165| DailyBulkV2QueryFileStorageMB | Per 24-hour rolling window | REST /limits |
166
167### Storage Limits
168
169| Limit | Scope | How to Check |
170|---|---|---|
171| DataStorageMB | Org-wide | OrgLimits / REST /limits / Setup |
172| FileStorageMB | Org-wide | OrgLimits / REST /limits / Setup |
173
174### Platform Event Limits
175
176| Limit | Scope | How to Check |
177|---|---|---|
178| HourlyPublishedPlatformEvents | Per clock hour | OrgLimits / REST /limits |
179| HourlyPublishedStandardVolumePlatformEvents | Per clock hour | REST /limits |
180| DailyStandardVolumePlatformEvents | Per 24-hour rolling window | REST /limits |
181
182### Async Processing Limits
183
184| Limit | Scope | How to Check |
185|---|---|---|
186| DailyAsyncApexExecutions | Per 24-hour rolling window | OrgLimits / REST /limits |
187| ConcurrentAsyncGetReportInstances | Concurrent | REST /limits |
188
189---
190
191## Official Sources Used
192
193- Apex Reference Guide -- OrgLimits class and OrgLimit methods
194- REST API Developer Guide -- Limits resource (`/services/data/vXX.0/limits`)
195- Salesforce Help -- Monitor API Usage and Limits
196- Salesforce Well-Architected Overview -- Operational Excellence pillar