Knowledge Base

Usage Billing Plugin — Collection, Rollups & Invoicing

The Usage Billing plugin samples every active storage service hourly, keeps raw snapshots, rolls them up per month, and can append overage lines to invoices. Its pages live in staff navigation as S3 Usage; settings are under Settings > Company > Plugins > S3 Usage Billing > Manage.

Data sources

  • Bandwidth — read directly from the storage server's metrics v3 endpoint; the collector signs its own bearer token from the server row credentials. Only sent bytes (egress) are billable; received bytes are stored for visibility.
  • Disk — read from Prometheus using the server row's Prometheus fields. No Prometheus = no disk figures or quota alerts, but bandwidth still works.

Both sources require MinIO — RustFS does not yet document compatible metrics endpoints, so usage billing is MinIO-only for now (see Installation & Requirements and Prometheus Setup).

Settings (all default OFF)

  • Collect bucket usage from cron — the master collection switch. Enable this first.
  • Calculate egress billing values / Calculate disk billing values — allow amounts to be computed. Each also requires the matching package field (see Package Setup & Pricing).
  • Append usage overage to monthly service invoices — the only switch that actually touches invoices. Enable it last, after you've reviewed a month of rollups.
  • Keep raw snapshots for N months (min 2) — retention for the raw hourly samples; monthly rollups are kept forever.

Rollups and review flags

The S3 Usage pages show per-month, per-bucket rollups with summary tiles and drill-down to the raw snapshots. A rollup is flagged review required when samples are missing/failed, a quota is set while disk billing is on, or a billed month changed afterwards. Flagged rollups are never invoiced silently — resolve the flag first.

Invoice integration

When Blesta generates an invoice containing a storage service line, the plugin appends that service's unbilled closed months (every month up to and including last month) as separate line items. Rollups are stamped with the invoice they were billed on; a reservation mechanism prevents double-billing across concurrent invoice runs. Repricing: unbilled months always recalculate with current package prices; already-billed months are never re-billed — a post-billing change flags them for review instead.

Quota alert emails

Buckets with a quota alert their client at 90% used via the MinioUsageBilling.quota_threshold email template (at most one per bucket per 24h; re-arms below 85%).

Edit the template before going live — the plugin seeds it with placeholder data. Under Settings > Company > Emails > Email Templates, set:

  • From address — defaults to no-reply@<your hostname>; use a real address your mail setup can sign (SPF/DKIM), or alerts land in spam.
  • From name — defaults to a generic product name; use your brand.
  • Body/subject — adjust the wording; available tags: {client.first_name}, {bucket}, {service_name}, {used}, {quota}, {used_percent}.

Your edits survive plugin upgrades (re-seeding never overwrites an existing template). Disabling the template on that same page is the company-wide kill switch for alerts.

Please rate this article to help us improve our Knowledge Base.

0 0