Billing in Weave Cloud consists of the following components:
ingester
- a sidecar container that captures events from scope (or others) and writes billing events to BigQueryaggregator
- a job which periodically queries BigQuery and writes aggregated summaries to the billing DBuploader
- a job which once/day queries the users service and billing DB, then uploads daily summaries to zuoraenforcer
- a job which periodically queries trial expiration and triggers notificationsbilling-db
- a Postgres RDS instance container summaries billing infobilling-api
- a job which serves the billing API to users, for them to add credit card details, see usages etczuora
- an external service which actually does the billing
(Source)
The ingesters job is to collect billing events with and send them to BigQuery. It is a Fluentd instance with a custom plugin.
ingester/
contains the source files needed to make a Docker sidecar image that collects Billing events using Fluentd and sends them to a bigquery table for querying. This image is designed to be used in conjunction with the service-billing-client library.
Internal service and UI for billing admin
See the makefile for all instructions.
Most of the documentation is within the code.
Part of the testing typically involves interacting with Zuora manually, uploading usage, creating bill runs, etc. More information about this can be found here.