4

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.

  • 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. – Renato Oliveira Jul 10 '18 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 at 18:39
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

6

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).

3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.