Metering of resource usage
APPUiO Cloud is invoiced based on effective resource usage. Creating invoices based on that usage requires the means to collect data about the used resources.
APPUiO Cloud will not take the responsibility of managing an invoice lifecycle. Instead, an ERP or accounting system will be responsible for creating invoices based on the reported usage data, and for handling the invoice lifecycle.
System idea
The metrics of interest are already being measured by the monitoring system of an APPUiO Zone which is built on top of Prometheus. The amount of metrics collected usually results in a short retention time (in the range of days to weeks). In addition, the storage engine of Prometheus is not meant to be use for long term storage. Also the invoicing adapter should be able to invoice all the usage from all the APPUiO Zones. All of this calls for another system that collects, aggregates and stores those metrics.
Since the source of all the metrics is Prometheus, the most logical choice is to pair it with Mimir. It provides a collection of tools to solve different use cases that Prometheus can not solve on its own. One of those cases is storing metrics on a different system for long term storage.
On the output side, we have an adapter to the ERP/accounting system. Its purpose is to query the metrics, transform the data, and send it to the ERP/accounting system. The ERP/accounting system uses the reported usage data to generate invoices. The adapter requires some static configuration, which allows it to map usage data to ERP-specific product definitions.