Skip to content

[User Story] Billing-grade metric export & persistence #97

Description

@arasHi87

Description

As a billing / consumption system, I want cumulative, restart-safe per-tenant and per-server usage counters exposed over Prometheus so that I can bill network traffic accurately across agent restarts, crashes, and reboots.

Acceptance Criteria

A detailed list of conditions that must be met for the story to be accepted. These statements must focus on functional behavior and constraints rather than specific code-level implementation.

  • lachesis_bytes_total / lachesis_packets_total are emitted by a custom prometheus.Collector (never a CounterVec) so counters never reset and rate() never goes negative.
  • A Write-Ahead Log persists GlobalState; counters are restored on boot with no double-counting.
  • Direction is exported as VM-frame tx/rx; the billing model and consumption contract are documented.
  • Per-server billing-grade export is available (server_id + external_network resolved), suitable for downstream CMP billing.

Story Points: ❓

Estimated at the Feature level — see child Features (#99, #107, #146, #150). User Stories are not separately pointed on the [Bigstack] scrum board (Story Points live on the pointed atom — this story's Features).

Output artifacts (Definition of Done)

Beyond code, docs, and config changes, completing this issue must also deliver:

  • Handbook knowledge update — land the durable, team-readable knowledge from this
    work into the bigstack-handbook cubecos kb (kb/cubecos/…) via
    /bigstack-core:save-to-handbook (Topic / Runbook / Known-issue / ADR as fits).

Progress

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions