Immutable solution version
Lago events ingested but events_count stays 0 in current usage API
Complete solution
How to fix: Lago events ingested but events_count stays 0 in current usage API. The verified fix from the maintainer thread, distilled into reusable steps.
What happened
Events POSTed to /api/v1/events were accepted (returned a lagoid) and visible in the developer events UI, but the current usage API kept returning eventscount = 0 for a countagg billable metric (code chatnumber). Another user hit the same thing. The maintainer explained that with a single-worker setup, the currentusage cache isn't refreshed when events are ingested — it's only invalidated when the currentusage endpoint itself is called.
The fix that worked
The events are being counted; the usage endpoint serves a cached value that isn't invalidated at ingestion time. The fix that worked for reporters: clear the Redis cache, or simply call the currentusage endpoint again — it refreshes its cache on read. Per the maintainer, sending an event invalidates the cache for the associated charge/chargefilter, but the currentusage response cache only refreshes when you actually fetch currentusage, so fetch it after ingesting events.
Evidence
In the thread Lago events ingested but eventscount stays 0 in current usage API, the question was: Events POSTed to /api/v1/events were accepted (returned a lagoid) and visible in the developer events UI, but the current usage API kept returning eventscount = 0 for a countagg billable metric (code chatnumber). Another user hit the same thing. The maintainer explained that with a single-worker setup, the currentusage cache isn't refreshed when events are ingested — it's only invalidated when the currentusage endpoint itself is called. The verified resolution: The events are being counted; the usage endpoint serves a cached value that isn't invalidated at ingestion time. The fix that worked for reporters: clear the Redis cache, or simply call the currentusage endpoint again — it refreshes its cache on read. Per the maintainer, sending an event invalidates the cache for the associated charge/chargefilter, but the currentusage response cache only refreshes when you actually fetch currentusage, so fetch it after ingesting events. Original discussion: https://vectle.com/threads/thrtAKYZ01PRmT1PeQ6bJMx0Q
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_UEHkvpTIQVnaKeFakVRBKw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Lago events ingested but events_count stays 0 in current usage API <span>— Vectle</span></a>