**CloudKitty** is the rating and chargeback module of the [[OpenStack]] ecosystem. It collects usage data from [[OpenStack]] services (compute hours, storage volume-hours, floating IPs, bandwidth) and applies configurable pricing rules to produce chargeback reports — telling you and your tenants what was consumed and what it cost. --- ### First Principle: You cannot bill what you cannot measure. Metering is the prerequisite for every revenue model. AWS bills to the second for every resource consumed. Replicating this requires a metering layer that collects usage data in near-real-time, applies pricing rules, and produces auditable billing records. CloudKitty sits between the raw [[OpenStack]] telemetry and the downstream invoicing system. --- ### Key Considerations - **Data Sources (Collectors)**: CloudKitty collects data from the [[OpenStack]] Gnocchi time-series database (Ceilometer metrics), [[Prometheus]], or custom REST collectors. Every resource type — instances, volumes, images, network — has a collector. - **Rating Modules**: CloudKitty applies pricing via "rating modules" — flat-rate, threshold pricing, and hashmap rules that map resource attributes (flavor, project, tenant) to prices. - **Storage Backends**: Rated data is stored in InfluxDB, Elasticsearch, or a SQL database for downstream reporting and billing system integration. - **Reports and Summary API**: CloudKitty exposes a REST API for querying usage summaries by project and time range — the data feed for your billing portal or invoice generation system. - **Gaps**: CloudKitty is a start, not a complete billing platform. It handles rating (cost calculation) but not invoicing (generating and sending bills), payment processing, or a customer-facing billing portal. - **[[Koku]] Relationship**: [[Koku]] focuses on cost visibility and optimisation across clouds. CloudKitty focuses on rating internal OpenStack resource usage. They're complementary for different parts of the billing problem. --- ### How It Fits ``` [[OpenStack]] services (Gnocchi/[[Prometheus]] metrics) → CloudKitty (collects usage, applies pricing rules) → SQL / InfluxDB (rated cost data) → Custom billing portal / invoice system ``` [[OpenStack]] | [[Koku]] | [[Prometheus]] | [[Open Source Hyperscaler MoC]]