Is there a way to set some alerts on the number of payloads or payloads per hour/minute?
We had a fleet of devices reset to send a payload every second and quickly racked up thousands of unintentional payloads in a short period of time.
Can this be done with some kind of workflow?
If not, can I suggest account level alerts for this sort of thing? Might be nice to have alerts anyway for other things like billing, integration messages, etc etc to identify and correct.
It’s a good suggestion. I’ll type it up as a feature.
Thinking we send an alert if …
- You come within 10% of your monthly payload limit
- You exceed your monthly payload limit
- Your payloads generated over a 72-hour period would be enough to put you over your monthly limit if continued on that pace
Yeah exactly… Maybe even customizable payload limit alert. User can set 10%, 15% whatever…
Has there been any activity on this request? I made a mistake on one of my flows and now I’m running without monitoring until next month.
I know it isn’t Losant’s fault, but it would be nice if I knew I was running up against the wall as I could have fixed the issue before it became a problem.
There actually has, pretty recently - but only for organizations. And based on your description it sounds like your application may be in a free sandbox account. The usage notifications are only sent to organizations.
That said, I will file a ticket about getting this feature enabled for sandbox accounts as well.
You could write a workflow that would alert you that you are approaching your sandbox’s payload limit - though every time the workflow runs, that itself would count as a billable payload. Something like the following …
- Timer Trigger (say, once a day).
- A pair of Date/Time Nodes in sequence to get the start and end of the current month, in Epoch milliseconds format.
- HTTP Node that hits the Me: Payload Counts API endpoint.
- The
start
and end
for the call were retrieved using the Date/Time Nodes.
resolution
would be 86400000
, which returns you per-day counts.
- You would need to create a User API Token to authenticate this request. You’d want to limit it to only the Me: Payload Counts call mentioned above, and you should also store it in an HTTP Service Credential.
- A Function Node to iterate over the response’s properties and sum the values.
- A Conditional Node to compare the payload sum to your account limit. For example, say you want to send an alert when the usage reaches 90% of the limit, the expression would be something like
({{working.payloadSum}} / {{limit}}) >= 0.9
.
- The
true
path would lead to an SMS Node or an Email Node or however you want to receive the alert.
- The
false
path goes nowhere.
You may also want to add some logic to prevent the workflow from sending the alert every day you are over the limit, which you could accomplish by setting a flag and checking it at the top of your workflow using the Storage: Get Value and Storage: Set Value Nodes. Separately you’d want to reset those at the start of the next month, which you could do with a separate Timer Trigger running once a month in the same flow.
I can work with this - thank you as always Dylan!