Billing Design
In a cloud billing system using Gnocchi as the source for metered usage data, Gnocchi stores and processes time series data related to resource consumption. Key factors such as instance flavor, volume size and type, network traffic, and object storage can all be stored in Gnocchi, enabling them to be queried later for usage-based billing of Genestack tenants.
Billing Workflow
-
Data Collection: OpenStack Ceilometer continuously collects telemetry data from various cloud resources via polling and notification agents.
-
Data Aggregation and Storage: Ceilometer forwards this raw usage data to Gnocchi. Gnocchi automatically aggregates and stores these metrics in an optimized, scalable format — ensuring that large volumes of data can be handled efficiently.
-
Querying Usage Data: The billing system queries the Metrics API to retrieve pre-aggregated metrics over specified time periods (e.g., hourly, daily, or monthly usage). Gnocchi provides quick access to the stored data, enabling near real-time billing operations.
-
Converting to Atom Events: The billing system converts the collated resource usage data into Atom events before submitting them.
-
Submitting Events to Cloud Feeds: Newly created Atom events are sent via HTTPS to Cloud Feeds.
-
Usage Mediation Services: Our UMS team receives the metered usage events from the named feed, then does further aggregation before emitting the usage to be invoiced.
-
Billing and Revenue Management: Finally, the aggregated usage from UMS is received and processed by BRM to create the usage-based invoice for each tenant.