drop metering alerts to low severity (#3212)
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled

This commit is contained in:
Daniel Salazar
2026-06-04 14:01:44 -07:00
committed by GitHub
parent 918aba9c80
commit 9bbc76b2dd
2 changed files with 6 additions and 2 deletions
@@ -395,6 +395,8 @@ describe('MeteringService', () => {
expect.stringContaining('usage exceeded'),
expect.stringContaining('exceeded their usage allowance'),
expect.objectContaining({ totalUsage: expect.any(Number) }),
// Non-paging severity — records and de-dupes but doesn't page on-call.
'warning',
);
alarmSpy.mockRestore();
});
@@ -184,7 +184,7 @@ export class MeteringService extends PuterService {
PERIOD_ESCAPE,
);
const appId = actor.app?.uid || GLOBAL_APP_KEY;
const userId = actor.user.uuid;
const userId = actor.user.uuid!;
const pathAndAmountMap = {
total: totalCost,
[`${escapedUsageType}.units`]: usageAmount,
@@ -360,7 +360,7 @@ export class MeteringService extends PuterService {
}
const appId = actor.app?.uid || GLOBAL_APP_KEY;
const userId = actor.user.uuid;
const userId = actor.user.uuid!;
const actorUsageKey = `${METRICS_PREFIX}:actor:${userId}:${currentMonth}`;
const actorUsagesPromise = this.stores.kv
@@ -933,6 +933,8 @@ export class MeteringService extends PuterService {
totalUsage: actorUsages.total,
monthUsageAllowance: actorSubscription.monthUsageAllowance,
},
// Expected-but-worth-tracking signal — record/de-dupe it but don't page on-call.
'warning',
);
}