Skip to main content

How PAYG metering and billing works

This page is for platform operators who run pay-as-you-go (PAYG) billing on a Kube-DC installation. It explains the whole path: how usage is sampled, how each UTC hour is proven, how hours are priced, and how a monthly statement becomes a paid invoice. It also lists every workload that takes part.

To turn PAYG on, read PAYG billing (optional). To select sources and run the first statement, read the billable PAYG profile.

From a resource to a paid invoiceFour kinds of source feed PAYG: the cluster inventory for CPU, memory, public IPv4 and local-path volumes; Ceph for RBD block images, RGW buckets and backups; stock Loki and Mimir for log writes and active metric series; and managed services for plan and Kubernetes management fees. The minute collector in kube-dc-metering reads the inventory every minute and writes hour segments and hourly receipts. Five-minute evidence workers capture the other sources at thirteen boundaries per hour and project proven hours. Both write to the metering database, which holds the usage journal, retained evidence, proofs, hourly receipts, rollups and the decision index. The settlement worker prepares each closed hour during the month. After the cutoff it seals a paid or free decision for every organization, meter and hour, rates the paid hours and finalizes the statement. The statement is approved by finance, or automatically for an enrolled payer, exported as a Stripe invoice and reconciled until it is paid.Cluster inventoryCPU · memory · IPv4local-path volumesCeph storageRBD block imagesRGW and backupsLogs and metricsLoki chunk writesMimir seriesManaged servicesservice plan feesKubernetes feesMinute collectorkube-dc-metering · 1 minhour segments · receiptsEvidence workersfive-minute captures13 boundaries per hourMetering databasejournal · evidence · proofsreceipts · rollups · decisionsHourly preparationlatest closed hourduring the monthSeal and rateafter the cutoffpaid or free per hourFinalizefrozen exact totalstatement keyPaymentinvoice paidpayment hold clearedStripe invoicecents at exportreconciled statusApprovefinance, or automaticfor enrolled payersUnknown is never zeroA measurement gap frees the whole meter-hour; contradictory evidence stops the statement.
Usage is measured continuously, proven one UTC hour at a time, and priced only after the month's completeness cutoff. Finance approval, or automatic issuance for an enrolled payer, turns the frozen statement into an invoice.

Design rules​

These rules hold for every product and every source:

  • Evidence, not configuration, creates a charge. A price on the rate card does not bill anything by itself. Each charged quantity points to retained usage rows and the evidence behind them.
  • The hour is the unit of proof. PAYG proves usage one UTC hour at a time, during the month, while the evidence is fresh. Month-end processing reuses those hours instead of re-reading the whole month.
  • Unknown is never zero. A missed sample is a recorded gap, not zero usage. A gap makes the affected meter-hour free. It never becomes a guessed quantity.
  • Errors are not gaps. Contradictory ownership, corrupt evidence, an unpriced product or an invalid source authority stop the statement. They are never turned into free hours or zero usage.
  • Nothing is rewritten. Usage rows, rate-card revisions, sealed decisions, finalized statements and approvals are immutable. A correction is a new, typed record.
  • Billing stays outside the write path. Customer workloads, log writes and metric writes never call or wait for PAYG, its database or the payment provider. If billing stops, tenants keep running and the affected hours are free.

Components​

What runs for PAYGIn the monitoring namespace, the kube-dc-metering Deployment runs the minute collector, the producer and billing APIs, journal rollups and the Stripe exporter. The kube-dc-settlement-worker Deployment runs the monthly settlement schedule. Storage capture, fee census and stock telemetry CronJobs record evidence; the hour proof and payable projector CronJobs turn closed hours into proofs and usage rows; evidence upkeep CronJobs maintain the hot archive. All of them write to the PostgreSQL metering database. The exporter creates invoices in Stripe, and finished evidence moves to object-locked, KMS-encrypted object storage.DEPLOYMENTS AND CRONJOBSkube-dc-meteringcollector · producer APIbilling API · exporterSettlement worker/payg-statement scheduleopen · prepare · sealStorage capturesRBD · RGW censusesevery 5 minutesFee censusesservices · Kubernetesevery 5 minutesTelemetrystock Loki · Mimirhourly at :05Hour proofsselected-hour-proofsevery 5 minutesPayable projectorlatest two hoursevery 5 minutesEvidence upkeephot archive · GCevery 5 minutesStripeinvoicessigned webhooksPostgreSQLjournal · evidenceverified TLSObject storageobject-locked copiesKMS-encryptedBilling stays outside the write pathCustomer workloads, logs and metrics never wait for PAYG, its database or Stripe.
Two long-running Deployments and a set of CronJobs make up PAYG. Every workload connects to the metering database with its own small pool and verified TLS.

All PAYG workloads run in the monitoring namespace. They are deployed by the optional platform/payg Fleet bundle and the source bundles that an installation selects.

ComponentKindResponsibility
kube-dc-meteringDeployment, one replicaMinute collector, producer API, billing API, journal rollups, budget evaluation and the Stripe exporter.
kube-dc-settlement-workerDeployment, one replicaRuns /payg-statement schedule: opens monthly periods, prepares closed hours, and seals, closes and finalizes due periods.
Storage capturesCronJobsCapture Ceph RBD images and RGW buckets every five minutes.
Fee censusesCronJobsCapture managed-service and Kubernetes fee records every five minutes.
Stock telemetryCronJobsRead Loki and Mimir usage for the previous hour, once per hour.
Hour proofs and payable projectorCronJobsProve each closed source hour and project it into usage rows.
Evidence upkeepCronJobsMove finished evidence to the archive and expire unreferenced raw data.
Metering databasePostgreSQL databaseUsage journal, evidence, proofs, decisions, statements and approvals.
Backend and consolesKube-DC chartTenant estimates, invoices and payment method; admin rate cards, policies and settlement periods.

The jobs reference lists each CronJob with its schedule.

The metering database uses its own role and verified TLS. By default it shares the installation's PostgreSQL cluster. A large installation can select a dedicated cluster. Each workload uses its own small connection pool.

What is measured​

Each priced product on the rate card names one meter. The meter decides which source measures it and how. The following table shows the products of a typical card.

Product familyExample SKUsMeasured fromMeasurement
Computecompute.standard.cpu, compute.standard.memoryMinute collectorKubelet-admitted effective requests of running Pods, including the Pods that run virtual machines. Pod overhead is not charged.
Public IPv4network.ipv4Minute collectorEach public address held by an EIp, from allocation until release.
Local-path disksstorage.block.local_pathMinute collectorProvisioned capacity of local-path volumes.
Ceph block storagestorage.block.ceph_rbdRBD captureProvisioned size of each RBD image, at five-minute boundaries.
Object storagestorage.object.currentRGW captureAll stored bytes of a bucket, at five-minute boundaries.
Backupsstorage.backup.base, .incremental, .wal, .replicaRGW capture and archive registrationsBytes in registered backup archive roots, at five-minute boundaries.
Managed-service feesservice.<family>.<tier>.managementFee censusService-seconds of one logical managed service.
Managed Kubernetes feesservice.kubernetes.standard.management, service.kubernetes.ha.managementFee censusService-seconds of one managed control plane.
Metricsmetrics.active_seriesStock telemetryActive series per tenant on a five-minute grid.
Logslogs.compressed_writesStock telemetryBytes of successfully stored, compressed log chunks.

A product without a qualified source stays disabled on the card. It is listed but cannot create charges. Prices are quoted per hour, per GiB, or per 730 hours, which is a quote basis for one month. Calendar months can be longer or shorter; the exact quantity is always charged.

Minute collection​

The minute collector in kube-dc-metering measures compute, public IPv4 and local-path disks.

Minute collection becomes hour segmentsEvery minute the kube-dc-metering collector lists Organizations, Projects, Namespaces and the resources it prices from the Kubernetes API, and reads kube-state-metrics resource requests from Prometheus. It evaluates one minute per organization in memory. Consecutive identical minutes of one component form a segment that never crosses a UTC hour boundary; a change of quantity, owner, price revision, or a missed minute closes the segment. Every five minutes, at each hour boundary and on shutdown, the single fenced writer commits, per organization, the closed segments into the usage journal, replaces the organization's checkpoint of open segments, and writes the coverage of completed hours as a sixty-bit minute map per meter family.KUBE-DC-METERING · ONE FENCED WRITERMETERING DATABASEKubernetes APIorgs · projectspods · VMs · PVCsPrometheuskube-state-metricsrequests · phaseMinute evaluationone minute per orgrate × 60 s per itemHour segmentscloses on change, gapor the end of the hourTick transactionfence · segmentscheckpoint · coverageUsage journalimmutable segment rowsone id per windowCheckpointone row per orgopen segments · cursorCoverage hours60-bit minute mapper family and hourAn unobserved minute is never a zeroA missed minute closes the segment and stays a coverage gap. Nothing is charged for it.
The collector evaluates every organization every minute in memory and persists only hour-bounded segments. One fenced writer commits closed segments, checkpoints and coverage in one transaction per organization tick.

Every minute, the collector does the following:

  1. Lists Organizations, Projects, Namespaces and the priced resources from the Kubernetes API.
  2. Reads resource requests and Pod phase from kube-state-metrics through Prometheus. A query result older than 90 seconds counts as missing.
  3. Evaluates one minute for every participating organization, in memory.
  4. Extends or closes hour segments. A segment is a run of identical minutes of one component: one resource, meter, owner, price revision and quantity. A segment never crosses a UTC hour boundary. A change, a missed minute, or the end of the hour closes it.

Every five minutes, at each hour boundary and on shutdown, the collector runs one tick transaction per organization. The transaction checks the writer fence, inserts the closed segments into the usage journal, replaces the organization's checkpoint of open segments, and writes the coverage of completed hours.

Coverage is a 60-bit map of observed minutes per organization, meter family and hour. When an hour is fully covered, the collector writes an hourly collector receipt. Settlement reads these receipts instead of the individual segments.

The collector has one writer. It holds a database lock for its lifetime, and a stale writer cannot insert anything. After a restart, the collector resumes from its checkpoints. The minute of the restart has no previous sample, so it is a recorded gap.

By default, only organizations on a PAYG policy are collected.

Five-minute source evidence​

Ceph storage and managed-service fees are proven from five-minute captures. Stock telemetry uses the same five-minute grid.

One source hour, thirteen boundariesOne UTC hour H has thirteen five-minute boundaries: H:00, H:05 and so on to H:55, plus the next hour's H:00. The first and last boundaries are shared with the neighbouring hours. A CronJob captures the source at each boundary and retains the exact capture with its ownership bindings. After the hour closes, a worker builds a source-hour proof that requires all thirteen boundaries and a reconciled payer for every quantity. A proven hour is projected into usage rows per organization and Project. Capacity is integrated with the trapezoid rule: each of the twelve intervals contributes the sum of its two samples times 150 seconds, so endpoints weigh 150 seconds and interior samples 300 seconds.00051015202530354045505500Thirteen of thirteen, or the hour is not provenEndpoints are shared with neighbouring hours. One missing boundary leaves the hour incomplete.CaptureCronJob, every 5 minread-only accessOriginalexact and retainedowner bindingsHour proof13 of 13 presentpayer reconciledProjectionusage rows perorg and ProjectCapacity is integrated, not averagedByte-seconds = sum over 12 intervals of (left + right sample) × 150 s.
A storage, fee or telemetry hour is proven only from all thirteen five-minute boundaries. Each boundary is captured once, retained exactly, and shared with the neighbouring hour.

A capture CronJob runs at every five-minute boundary and retains the exact capture. After the hour closes, two workers build on those captures:

  • The hour proof worker, kube-dc-selected-hour-proofs, revalidates each physical source for the latest closed hours. It writes one proof per source and hour.
  • The payable projector, kube-dc-s3-payable-evidence running the collect-live-native-hours action, projects proven hours into usage rows. Despite its historical name, it covers RBD, object storage, backups and both fee families.

Both workers wait four minutes after the hour ends, then process the latest two closed hours. They never accept explicit date ranges, so they need no monthly reconfiguration. The projector attempts at most one expensive hour per physical store in each pass. Hours that are already projected are skipped, so a retry is safe and an older hour catches up on the next pass.

An hour is proven only when all thirteen boundaries are present and every quantity has a reconciled payer. A missing, late or conflicting sample leaves the hour incomplete.

Ceph block storage​

kube-dc-rbd-census reads the Ceph pools and RBD images every five minutes, together with the PersistentVolumes, PersistentVolumeClaims, Namespaces, Projects and Organizations that own them. It runs its Ceph commands only in the dedicated kube-dc-payg-ceph-tools StatefulSet. It verifies the identity of that pod before and after each read.

When a new customer image appears, the capture adopts it. Adoption checks the CSI reservation, the volume and claim UIDs, the Namespace, Project and Organization chain, and the StorageClass. It then records a payer binding and a class binding. These bindings outlive the claim, so a retained volume stays attributed to its payer.

An image without a payer is an unattributed gap. That image is charged to nobody, and the rest of the hour is billed. For every hour, the observed capacity equals paid plus platform plus pending plus unattributed capacity.

Object storage and backups​

kube-dc-rgw-census reads the population of every RGW bucket at each boundary, using the same toolbox pattern. The S3 inventory producer, kube-dc-s3-producer, independently records which ObjectBucketClaim, Project or Organization owns each bucket. The collector also records its own witnesses of claims and object-store users.

Backups are a subset of object storage. The managed-services hub registers each backup archive namespace with the billing API. At each boundary, the bytes under a registered archive root move from generic object storage to the matching backup SKU. Customer and platform shares must add up to the observed total. A registration is permanent, so a backup keeps its payer after the service is deleted.

kube-dc-s3-hourly-audit runs at minute five of each hour. It certifies the previous sampled hour and writes a non-billable preview. The payable projector writes the charged quantities.

Managed-service and Kubernetes fees​

A managed service carries one fixed management fee, prorated by service-time. Replicas, Pod sizes and storage do not multiply it. The service's dedicated CPU, memory and storage are charged separately as ordinary resources.

The Services hub and runner, and the Kubernetes control-plane manager, write signed, immutable lifecycle records for each service. Fee census CronJobs capture those records every five minutes. A fee hour needs all thirteen captures, a baseline from before the hour, and a fee enrollment that was activated before the hour started. The enrollment pins the writers it trusts. When a release replaces the writers, the writer-renewal CronJob activates a successor at the next whole hour, and the hours in between are free.

For setup, read managed-service fees.

Stock telemetry​

Logs and metrics are measured from stock, unmodified Loki and Mimir. Nothing in the log or metric write path calls billing.

At minute five of each hour, kube-dc-stock-mimir-shadow and kube-dc-stock-loki-shadow read the previous hour from Prometheus on the same 13-point, five-minute grid:

  • Metrics: cortex_ingester_active_series, per tenant. The quantity is series-seconds, divided by the replication factor.
  • Logs: the increase of loki_ingester_chunk_stored_bytes_total, per tenant. Successful recovery rewrites count as writes.

The workers also check scrape freshness, up, process restarts, ring membership, build information and, for Mimir, the replication factor. A restart, a ring change or a missing point makes the hour unknown for that backend.

Only tenants named namespace-<Namespace UID> select a customer. The Namespace UID is matched to its organization and Project for the whole hour. Platform tenants and Namespace names never select a payer. Each run writes unpriced hourly receipts and, for organizations on a PAYG policy, the payable projection.

Producers and the usage journal​

The usage journal is the single, append-only record of priced usage. It is partitioned by month. The minute collector writes segments into it directly. Every other source writes as a registered producer.

  • Declaration. The installation declares its trusted producers in PAYG_DECLARED_PRODUCERS. Each entry binds a producer ID to one identity, its meters and its scope. Changing a declaration opens a new epoch.
  • Delivery. An external producer posts numbered batches with its Kubernetes ServiceAccount token. The receiver checks the token, the identity, the scope, the open epoch and the sequence in one transaction. It acknowledges only after commit. A skipped sequence is recorded as a hole.
  • Internal projectors. RBD, object storage, backup, fee and telemetry projections write under reserved internal identities. These meters cannot be delivered through the producer API.
  • Refusals. A refused batch stays in the producer's spool. Evidence that ages out of the spool is reported as a gap before it is dropped.

Attribution​

Each usage row belongs to one organization and, where it applies, one Project. The collector records ownership intervals as it observes Namespaces, Projects and Organizations. Sources resolve their payer from those intervals and from their own retained bindings, never from names alone.

Missing ownership is a gap. Two contradictory owners for the same hour are an error that blocks the statement.

The meter-hour rule​

Usage is charged in decisions of one organization, one meter and one UTC hour, across all Projects, resources and sources.

Paid, free or blocked: the meter-hour ruleThe decision unit is one organization, one meter and one UTC hour across all Projects, resources and sources. When every required source is complete and reconciled, the hour is paid and rated at the exact rate-card price; cents are rounded only at export. When a typed measurement gap exists, the whole meter-hour is free, including any observed part, and the statement lists it with its reason; it can never be charged later. When evidence is contradictory or corrupt, a product is unpriced, or source authority is invalid, the hour is an error, the period cannot finalize, and an operator must resolve it. Decisions are sealed after the completeness cutoff.Meter-hourone organizationone meter · one hourPaidevery source completeand reconciledFreetyped measurement gapwhole hour, disclosedBlockedconflict · corrupt dataunpriced · bad authorityRated lineexact price × quantitycents at exportFree hour on statementlisted with a reasonnever charged laterStatement waitsperiod cannot finalizeoperator resolvesDecisions are sealed onceAfter the cutoff, late evidence cannot turn a free hour into a charge.
Every organization, meter and UTC hour receives exactly one sealed decision. Complete evidence is charged, a measurement gap is free and disclosed, and an integrity error stops the statement until an operator resolves it.
OutcomeWhenEffect
PaidEvery required source for the meter-hour is complete and reconciled.The hour is rated at the exact rate-card price.
FreeA typed measurement gap exists.The whole meter-hour is free, including any observed part. The statement lists it with its reason.
BlockedContradictory or corrupt evidence, an unpriced product, an invalid source authority, or a database or transport failure.The period cannot finalize until an operator resolves the error.

Free meter-hours are enabled per settlement policy, as the free-meter-hours.v1 rule. Decisions are sealed once, after the period's completeness cutoff. Evidence that arrives later cannot turn a free hour into a charge or a positive correction.

Rate cards and money​

A rate card has immutable, published revisions. Each organization's billing policy names one revision. Changing a price means publishing a new revision and moving organizations to it at a future boundary.

  • Pricing context. A minute is priced by the policy and card revision in force at its start. A change effective at 10:17:30 applies from the minute that starts at 10:18. A segment never spans two revisions, and retroactive changes are refused.
  • Units. Each rate has a price unit and a conversion from the meter's base unit. For example, CPU is metered in vCPU-seconds and priced per vCPU-hour, which is 3,600 vCPU-seconds.
  • Precision. Rating uses exact rational arithmetic. Each figure on a line is rounded once, half-up, to 12 decimal places.
  • Cents. The statement total stays exact until export. The exporter rounds the net total once to the currency's minor unit, half away from zero, then spreads the cents across lines by largest remainder, so the lines add up exactly. The JSON and CSV files use the same rule.
  • Credits. Amounts are never negative. A credit is a typed correction.

Monthly settlement​

A settlement period covers one organization for one UTC calendar month. The settlement worker, kube-dc-settlement-worker, runs every minute, and runs back to back while it makes progress.

Why the month closes quicklyDuring the month, collectors write hourly receipts and evidence workers write source-hour proofs and payable projections. The settlement worker prepares the latest closed hour on each pass, about four minutes after the hour ends. At the end of the month plus the configured cutoff, the worker classifies the month in two-hour slices, re-checks hours whose evidence changed, and seals the paid or free decision index in one write. It then rates the paid hours and finalizes the statement with a frozen total and statement key.Every hourreceiptsproofs · rollupsPreparelatest closedhour, each passCutoffend of month+ cutoffSeal2-hour slicesone index writeFinalizerate paid hoursfreeze total
Most of the work happens hour by hour during the month. After the cutoff, the worker only classifies the remaining hours, seals the decisions, rates and freezes the statement.

Each pass has these phases, each with its own time budget:

  1. Opening. Opens the current month's period for every account the standing policy covers, and catches up the previous month after a missed pass.
  2. Due. Seals, closes and finalizes periods whose cutoff has passed.
  3. Source continuation. In the last seven days of the month, continues the configured source enrollments into the next month.
  4. Preparation. For each open period, prepares the latest closed hour and one older slice. It verifies telemetry, writes collector receipts and prepares the shared source proofs. Preparation never rates or seals.

Completeness cutoff​

The cutoff is the end of the month plus PAYG_SETTLEMENT_CUTOFF. The bundle's default is 1h, and the qualified paid profile uses 2h. Evidence that arrives before the cutoff counts. An operator can extend the cutoff of an open period with an append-only extension that keeps the original deadline on record.

Automation policy​

PAYG_SETTLEMENT_AUTOMATION is the standing authorization for automatic settlement. It is a JSON object:

{
"version": "settlement-automation.v1",
"scope": "billable-accounts",
"effectiveFrom": "2026-01-01T00:00:00Z",
"freeMeterHours": true,
"finalize": true,
"continueSources": true,
"earliestMonth": "2026-01"
}

freeMeterHours applies the meter-hour rule. finalize lets the worker freeze statements. continueSources lets it carry source enrollments into the next month. Approval is a separate act, described in Statements, approval and invoices.

What happens after the cutoff​

Because hours are prepared during the month, the work after the cutoff is bounded:

  1. The worker classifies the month in two-hour slices. Each slice commits on its own, so a restart resumes where it stopped.
  2. It re-checks free decisions and paid hours whose evidence changed since preparation.
  3. It seals the plan and writes every paid or free decision in one statement.
  4. Close rates the paid hours against the sealed plan. Rated lines keep pointers to their journal rows. Clean hours reuse the hourly rollups; only changed or partial hours read the raw journal.
  5. Finalize rechecks the evidence pointers and freezes the total. The period then has an immutable statement key.

A period whose meters all come from the minute collector seals directly from the hourly collector receipts.

Period states​

StateMeaning
openThe month is collecting and preparing.
closingRating found gaps or unpriced components to resolve.
validatedRated with no open gaps or unpriced components.
finalizedFrozen. Only export, acknowledgement or failure can follow.
exportedAn invoice or export was created for the approved statement.
acknowledgedThe payment provider confirmed the invoice.
failedThe period could not complete and needs an operator.

Statements, approval and invoices​

From a frozen statement to a paid invoiceA finalized settlement period has a frozen total and a statement key. Finance approves the exact key in the admin console, or the exporter approves automatically for an enrolled payer, and an immutable snapshot is saved with the approval. The exporter rounds the net to cents once, creates and finalizes one Stripe invoice for the statement key, and marks the period exported. When Stripe reports the invoice open or finalized, the period is acknowledged. When the invoice is paid, the payment state updates and any payment hold is released.Finalizedfrozen totalstatement keyApprovedfinance orautomaticExportedStripe invoicecents roundedAcknowledgedinvoice seenopen in StripePaidpayment statehold released
A finalized statement is immutable. Approval saves a snapshot of it; export creates one Stripe invoice per statement key, and reconciliation follows Stripe until the invoice is paid.

A finalized statement contains its lines (SKU, meter, quantity, unit price, amount, rate and policy revisions), Project and service attribution, adjustments, free meter-hours with their reasons, and a money block with the minor-unit total.

Approval​

Approval names the exact statement key, so a changed statement cannot be approved by mistake. An immutable snapshot of the statement is saved with the approval. The snapshot stays available after the raw evidence is archived.

There are two approval paths:

  • Finance approval. A platform administrator reviews and approves the statement under Settlement periods in the admin console.
  • Automatic issuance. With the optional automatic-stripe-issuance component, the exporter approves a statement automatically when the payer is enrolled for recurring billing, the period starts at or after PAYG_EXPORT_AUTO_ISSUE_FROM, the worker finalized the period after its cutoff, and the period has no corrections.

Export​

An approved statement leaves Kube-DC in one of two ways:

  • JSON or CSV file. Download it from the admin console or with /payg-statement approved-export. Import it into an existing billing system and deduplicate on the statement key. A download does not record delivery.
  • Stripe invoice. With PAYG_EXPORT_PROVIDER=stripe, the exporter in kube-dc-metering runs every ten minutes. It records its intent, looks for an existing invoice with the same statement key, and otherwise creates one invoice item per line, checks the total, and finalizes the invoice. Its idempotency key and a per-period lock prevent duplicates.

PAYG_EXPORT_ORGANIZATION_UIDS and PAYG_EXPORT_APPROVED_AFTER limit which approvals can create invoices. PAYG_EXPORT_CREATION_PAUSED=T stops new invoices while existing ones keep reconciling.

Reconciliation and payment​

The exporter re-reads every exported invoice from Stripe. Signed Stripe webhooks reach the backend and are forwarded to the billing API as a faster path. The billing API always re-reads the invoice and applies each event once.

  • When the invoice is open, the period becomes acknowledged.
  • When the invoice is paid, the payment state updates.
  • When an invoice becomes uncollectible, a payment hold stops the organization from growing. Running workloads continue. The hold is released when no invoice of the organization is open or uncollectible.

Tenants see issued invoices, their payment status and the payment method under Manage organization > Billing & quotas.

Evidence retention​

Every charged quantity can be traced from its rated line to journal rows, sealed decisions, source proofs and retained originals.

  • Hot evidence stays in PostgreSQL while a period can still change.
  • Archive. With the optional hot-archive component, kube-dc-payg-hot-maintenance moves the bodies of financially finished evidence to two encrypted copies in object storage. A scope must be at least 30 days old, financially complete, verified in both copies and free of holds. Copies use object lock and server-side KMS encryption, and are kept for at least seven years.
  • Raw data expiry. kube-dc-payg-shared-gc expires raw capture data after seven days unless a proof, projection or decision still references it.

A missing or corrupt copy is reported as unavailable. It never becomes free usage or zero.

Tenant and admin views​

AudienceViewSource
TenantMonth-to-date estimate in Project > QuotaHourly journal rollups, priced at current list prices. A day still rebuilding shows as unknown, not zero.
TenantBudget and month-end forecastAdvisory. Budgets are evaluated every 15 minutes and send no email.
TenantBilling periods, invoices and payment methodSettlement periods and Stripe.
AdministratorPAYG pricesPublished rate-card revisions.
AdministratorOrganization billing tabBilling policy, holds and spending.
AdministratorSettlement periodsPeriod state, statement review, approval and file download.

An estimate is not an invoice. It can be incomplete until the period is sealed.

Jobs reference​

All jobs run in monitoring. Schedules are the bundle defaults in UTC. An installation runs only the bundles and components it selects.

WorkloadDefault scheduleBundle or componentPurpose
kube-dc-meteringContinuous, one-minute loopplatform/paygMinute collector, producer and billing APIs, rollups, budgets, Stripe export.
kube-dc-settlement-workerContinuous, one-minute passessettlement-workerOpen, prepare, seal, close and finalize periods.
kube-dc-rbd-census*/5 * * * *platform/payg-rbdCapture RBD images and adopt new customer images.
kube-dc-rgw-census*/5 * * * *platform/payg-rgwCapture RGW bucket populations and archive members.
kube-dc-s3-producerContinuous, five-minute alignedPer installationRecord bucket ownership.
kube-dc-s3-hourly-audit5 * * * *platform/paygCertify the previous sampled S3 hour.
kube-dc-managed-fee-census*/5 * * * *platform/payg-managed-feeCapture managed-service fee records.
kube-dc-managed-fee-writer-renewal2-59/5 * * * *platform/payg-managed-feeFollow Services releases with a successor enrollment.
kube-dc-kdc-fee-census*/5 * * * *platform/payg-kubernetes-feeCapture managed Kubernetes fee records.
kube-dc-kdc-fee-writer-renewal2-59/5 * * * *platform/payg-kubernetes-feeFollow control-plane manager releases.
kube-dc-stock-mimir-shadow5 * * * *stock-telemetry-shadowMeasure the previous hour's active series.
kube-dc-stock-loki-shadow5 * * * *stock-telemetry-shadowMeasure the previous hour's compressed log writes.
kube-dc-selected-hour-proofs2-57/5 * * * *selected-hour-proofs, continuous-source-hoursProve the latest closed source hours.
kube-dc-s3-payable-evidence3-58/5 * * * *continuous-native-hoursProject proven RBD, object, backup and fee hours.
kube-dc-backup-census, kube-dc-archive-census, kube-dc-native-backup-census*/5 * * * *platform/payg-backupDiagnostic backup custody. Creates no charges.
kube-dc-native-backup-hourly-audit5 * * * *platform/payg-backupCheck backup boundary coverage. Creates no charges.
kube-dc-payg-hot-maintenance*/5 * * * *hot-archiveArchive finished evidence.
kube-dc-payg-shared-gcEvery five minuteshot-archiveExpire unreferenced raw data.

When continuous-native-hours is selected, suspend the standalone projectors (kube-dc-rbd-payable, kube-dc-native-payable, kube-dc-managed-fee-payable and kube-dc-kdc-fee-payable). Running both paths duplicates expensive audits.

Database and scale​

  • Partitions. The journal is partitioned by month. The receiver creates future partitions ahead of time and checks them regularly. Old partitions can be detached and archived.
  • Rows. The collector writes one segment per resource and change, not one row per resource and minute. Hourly rollups keep tenant reads and rating proportional to the hours that changed.
  • Connections. Set PAYG_DB_CONNECTION_LIMIT and the matching managed role limit. Use 30 for a busy installation.
  • Durability. Plan WAL retention and backups for the evidence volume. See Prepare database durability.

Operate and troubleshoot​

CheckHow
Collector is runningkubectl -n monitoring logs deploy/kube-dc-metering | grep 'usage collection persisted' shows one line per minute.
Billing API is servingThe receiver logged billing schema migrated and billing API serving. GET /api/system/features reports "payg": true.
Settlement is progressingSettlement periods shows current periods as open and past periods moving to finalized after the cutoff.
Source hours are provenRecent hour proof and payable projector Jobs complete. A successful Job is not a complete statement; read its summary.

Common situations:

  • A source was down for an hour. The affected meter-hours are free. The statement lists them with their reason. No action is needed.
  • A period stays in closing. Rating found a gap or an unpriced component. Publish the missing price, or resolve the gap before the period can finalize.
  • A period cannot finalize because of a conflict. Two sources disagree about ownership or a capture is corrupt. Investigate the named evidence. Never delete evidence to unblock a period.
  • A Services release changed the fee writers. The writer-renewal job activates a successor at the next whole hour. Hours before it are free.
  • Billing must stop. Suspend the CronJobs through their configuration switches and let running Jobs finish. Suspending a Flux Kustomization does not suspend CronJobs that it already installed. Keep the database and approved statements.