ingestlayer/recipes

Monitor usage-limit hits

Know the moment a customer bumps a plan limit — the clearest upsell signal there is — with their plan and account owner already attached.

the event

Emit usage.limit_reached once; route it anywhere below.

  • customer_idstring
  • metricstringseats | api-calls | storage
  • limitnumber
  • usednumber
  • planstring
emit usage.limit_reached
import { ingest } from "@ingestlayer/sdk";

await ingest("usage.limit_reached", {
  customer_id: account.id,
  metric:      "api-calls",
  limit:       account.plan.apiLimit,
  used:        account.usage.apiCalls,
  plan:        account.plan.name,
}, {
  idempotencyKey: `${account.id}:api-calls:${period}`,
});

send it to