feat(metering): send the month's peak of extra targets (t72) #929

Merged
sharang merged 1 commits from feat/t72-extra-event into main 2026-11-06 15:55:44 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 3e376ba6b0 feat(metering): send the month's peak of extra targets (t72)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m5s
CI / Check (pull_request) Successful in 17m8s
The 5,99 € line bills the highest number of extra targets at once in
the calendar month (Europe/Berlin), with no proration.

- After each billing refresh (before a scan, when a target is created)
  the agent records how many active targets are extra as the month's
  peak, in metering_months.
- When the peak rises it sends `target.extra` with quantity = peak and
  the key target-extra:{tenant}:{YYYY-MM}:{peak}; once a day it sends
  the current peak again, which the registry drops as a duplicate of
  its key. Count only: no target names leave Prüfwerk.
- The quota filter also matches a month document without the counter,
  since the peak can create that document first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:21:29 +01:00