10

According to SU17 release notes there are the following Daily/Hourly limits for Platform events:

  • Maximum number of events published per hour
  • Maximum number of events delivered to CometD clients within a 24-hour period

Where can I see the number of consumed vs total allowance for Daily/Hourly limits for Platform Events in my org?

My test:

I created a custom event MyEvent__e in sandbox and launched it via REST API in workbench, also subscribed to the event in workbench (this is a CometD client and counts as DurableStreamingApiConcurrentClients)

I'm checking limits consumption in '/services/data/v43.0/limits' but I don't see any change in numbers apart from DailyApiRequests.

2
  • I'm also curious about this. Last time I checked it was not possible to query on the event table. What I do know is that you can view in the UI how many times the event was called. Jul 10, 2018 at 19:36
  • sort of -- there is a limit on # of published events that can be handled by trigger/PB = 100,000 per hour
    – cropredy
    Feb 27, 2019 at 18:39

5 Answers 5

3

Now with release Winter 21, you have a new feature which enables you to monitor it.

https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_monitor_usage.htm

Obtain Usage Metrics for the Last 24 Hours

To get usage metrics for the last 24 hours, ending at the last hour, perform a query by specifying the start and end date and time in UTC, and the metric name. For the last 24-hour period, the end date is the current date in UTC, with the time rounded down to the previous hour. The start date is 24 hours before the end date. Dates have hourly granularity.

9

Update from the Winter '20 release notes:

Monitor Platform Event Publishing Usage in REST API

The hourly event publishing usage for standard-volume and high-volume platform events is now available in REST API. Use the limits REST resource in your app to monitor your event publishing usage against the two allocations.

How: The limits resource contains these new values.

  • HourlyPublishedPlatformEvents—High-volume platform event notifications published per hour
  • HourlyPublishedStandardVolumePlatformEvents—Standard-volume platform event notifications published per hour

I've checked, and they are also exposed via the OrgLimits, so you can get them directly in Apex as well.


Comment from Jay Hurst (Salesforce PM for Platform Events):

There is currently not a way to actively check outside of using Shield Event Monitoring. We are planning on adding the current usage against the total limit to our REST API /limits resource. (Source)

So, beyond trying to track the limits yourself, I'd suggest voting to the idea: Expose Platform Event Limit Usage

7

I've checked every documentation on platform events I could find, and the answer is: you can't monitor it without doing the monitoring yourself.

You can create a custom object or a custom setting to store the event count, since platform events support after insert triggers. From there, you can determine how many calls were made during a specific day (and even get a report on it, if you use a custom object). Something along the lines of:

trigger MyEventTrigger on MyEvent__e (after insert) {
    // 1. Get your object that is being used as log
    // 2. increment with the value of Trigger.new.size()
    // 3. upsert said object
}

To avoid getting a huge record count, if you use a custom object, you can create one record for the day, or for the week. On the custom object you can have one field to track the amount for the day, or seven fields to track the days of the week (this seems more interesting since you can create formula fields to get averages on the same record, instead of using a report - just an idea).

5

As of the Spring '19 release you are now able to monitor Event Delivery through the limits resource via the REST API (stored in the DailyStandardVolumePlatformEvents response) - https://releasenotes.docs.salesforce.com/en-us/spring19/release-notes/rn_messaging_standard_volume_limit.htm

To monitor your monthly event delivery usage for High Volume Platform Events if you have purchased the add-on, use the limits REST API resource, and inspect the MonthlyPlatformEvents value. With the add-on purchase, they measure entitlement usage over the month rather than the strictly enforcing the daily limit. The limits resource returns the monthly maximum allocation - https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_event_limits.htm

3
  • I believe this only monitors CometD subscribers, not apex trigger/process builder subscribers
    – cropredy
    Feb 27, 2019 at 0:43
  • Correct @cropredy but Apex Trigger / Process Builders don't count against the Event Delivery Limit - developer.salesforce.com/docs/atlas.en-us.platform_events.meta/…
    – Clint
    Feb 27, 2019 at 13:31
  • 2
    Be aware that if you are purchasing the HVPE or CDC add-on to escape the daily limits for delivered events, that there is still a hard limit that exists which is not published. That limit appears to be (Number of Add-on Events Purchased/30)*5. Salesforce covers this under the descriptive "With the entitlement, you can exceed your 24-hour event delivery allocation by a certain amount." There also appears to be no way to monitor HVPE delivery in real-time. Jun 22, 2020 at 20:51
1

Salesforce Labs has an app published back in 2017:

Platform Event Usage Monitor

"Understand the platform event usage in your org! This package combines Apex Triggers and custom objects to drive Einstein Analytics insights on Platform Events Usage. Take further action with Einstein Analytics notifications."

There is also a newer AppExchange tool from Salesforce Labs that might fit the bill?:

Streaming Monitor

"Monitor streaming events (PushTopic, Generic, Platform Events, CDC, etc.) Developer/Admin tool that lets you monitor streaming events (PushTopic, generic, standard/custom platform events, CDC and monitoring events)

Install from the AppExchange or build from GitHub sources: https://github.com/pozil/streaming-monitor"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .