Usage still shows after deleting and recreating a billable metric
Last updated: June 29, 2026
A common way to wipe a subscription's usage in testing is to delete the billable metric, recreate it, and set the charge up again. Sometimes the old usage still appears on the subscription afterward. The cause is timing: deleting a metric triggers an asynchronous job to clear its events, and if you recreate the metric and re-add the charge before that job finishes, the subscription's cached usage is not purged and the old number lingers.
How the usage cache and event deletion interact
Subscription usage is cached. When a billable metric is deleted, Lago runs a background job to delete the old events, and the cache purge is tied to that deletion completing, because clearing the cache is only safe once the underlying events are gone. The job runs asynchronously, so its completion time varies. Recreating the metric and updating the plan before the job finishes is what leaves stale usage visible.
How to confirm the cause
Before re-adding the metric, list the events for the subscription and metric code. If events are still being returned, the deletion job has not finished and the cache has not purged yet. Seeing leftover usage together with events that have not cleared confirms this is the timing race rather than a different problem.
How to resolve the issue
Wait until no events are returned for the subscription and code before recreating the metric and re-adding the charge. Two practical options:
Check events first: poll the list events endpoint for the subscription and code, and only recreate the metric once it returns nothing.
Force a recalculation: sending a new event to the subscription using the same code also resets the displayed usage number.
A fix now purges the subscription-level cache automatically when a metric is deleted, but only after the event deletion job completes. If you still see stale usage, it means that async job has not finished yet. Once it does, usage reflects correctly.
This article reflects guidance drawn from customer case resolutions. It is not officially supported documentation and may not apply to all situations.