> ## Documentation Index
> Fetch the complete documentation index at: https://docs.conduktor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Chargeback

> Track Kafka cost allocation across teams with Conduktor Chargeback. Measure storage, partitions, ingress and egress, then group costs by cluster, application or label.

<Badge stroke color="blue" icon="sparkle" size="lg">Enterprise</Badge>

## Overview

Chargeback shows Kafka costs across five axes — storage, partitions, ingress, egress and Kafka Connect — and lets you group those costs by cluster, application or label. Each row supports drill-down into topics, service accounts and connectors.

For background on the cost axes and the metrics available per cluster type, see [Chargeback concepts](/guide/conduktor-concepts/chargeback).

<Info>
  **From our blog:** [Chargeback: attribute and map Kafka costs to your business](https://conduktor.io/blog/chargeback-attribute-map-kafka-costs-to-your-business) Practical strategies to tag, trace, and report Kafka spending by team and application.
</Info>

## Set up Chargeback

The first time an administrator opens the **Chargeback** page, an onboarding wizard runs through two steps:

<Steps>
  <Step title="Set cost rates">
    For each cluster, enter the unit costs that match your provider pricing or internal infrastructure model:

    | Field               | Unit              | Required |
    | ------------------- | ----------------- | -------- |
    | Bytes stored        | \$/GB/hour        | Yes      |
    | Partitions          | \$/partition/hour | Yes      |
    | Ingress             | \$/GB             | No       |
    | Egress              | \$/GB             | No       |
    | Connector task hour | \$/task/hour      | No       |

    Each value supports up to eight decimal places, with a maximum of `9.99999999`. Leaving ingress, egress or connector task hour empty is the same as `0`.

    The connector task hour cost is the default rate applied to every Kafka Connect connector task on the cluster. To charge different rates per connector type, add a per-connector-class override (for example, a higher rate for an S3 sink connector than for a JDBC source connector). An override takes precedence over the default for connectors of that class.
  </Step>

  <Step title="Select Chargeback Labels">
    Pick the label keys you want to group costs by (for example, `team`, `cost-center`, `env`).

    Only labels currently attached to topics or service accounts are offered. Conduktor-defined labels (the `conduktor.io/*` namespace) are excluded.

    You can skip this step and add Chargeback Labels later from the settings drawer.
  </Step>
</Steps>

After both steps are saved, Console begins applying these rates to the metrics already collected.

## View costs

Use the filter bar at the top of the page to control what's displayed.

| Control     | What it does                                                                                         |
| ----------- | ---------------------------------------------------------------------------------------------------- |
| **View by** | Group rows by Cluster, Application, Application Instance, or one of the configured Chargeback Labels |
| **Show**    | Pick which cost columns to display (Overall, Storage, Partitions, Connect, Ingress, Egress)          |
| **Period**  | Switch between 7D, 30D, 6M, 12M and YTD                                                              |
| **Search**  | Narrow the rows by name match within the current view                                                |

The chart at the top shows the totals for the active view across the selected period. The table below lists each entity with its measured value, calculated cost and percentage of the total.

### Drill into topics and service accounts

Each row in the **Cluster**, **Application Instance** and **Label** views can be expanded to show the topics, service accounts and connectors that contributed to it.

* **Topics**: storage, partitions, ingress and egress per topic
* **Service accounts**: ingress and egress per service account
* **Connectors**: connect cost per connector, grouped by Kafka Connect cluster, with the connector class shown

Service account drill-downs depend on the cluster type, and connector drill-downs require the cluster to have Kafka Connect configured. See the cluster-type capability matrix in [Chargeback concepts](/guide/conduktor-concepts/chargeback#what-you-can-measure-per-cluster-type).

## How metrics are calculated

Metrics are stored as raw counters and costs are computed at query time. Updating a unit cost takes effect immediately across all historical periods.

<Tabs>
  <Tab title="Storage">
    ```
    storage_cost = (byte_hours / 1,073,741,824) × bytes_stored_per_hour_cost
    ```

    `1,073,741,824` is one GB in bytes (1024³). `byte_hours` accumulates from periodic snapshots: each snapshot multiplies the topic's current retained bytes by the snapshot interval expressed in hours.
  </Tab>

  <Tab title="Partitions">
    ```
    partition_cost = partition_hours × partition_count_per_hour_cost
    ```

    `partition_hours` accumulates the same way as `byte_hours` — each snapshot multiplies the topic's partition count by the snapshot interval in hours.
  </Tab>

  <Tab title="Ingress">
    ```
    ingress_cost = (received_bytes / 1,073,741,824) × ingress_cost_per_gb
    ```

    `received_bytes` is sourced from the Confluent Cloud Metrics API for Confluent Cloud clusters, and from the Gateway observability Interceptor for Gateway clusters.
  </Tab>

  <Tab title="Egress">
    ```
    egress_cost = (sent_bytes / 1,073,741,824) × egress_cost_per_gb
    ```

    `sent_bytes` follows the same source rules as `received_bytes`.
  </Tab>

  <Tab title="Connect">
    ```
    connect_cost = task_hours × connector_task_hour_cost
    ```

    `task_hours` accumulates the running time of each Kafka Connect connector's tasks over the period. `connector_task_hour_cost` is the per-connector-class override when one matches the connector's class, otherwise the cluster's default connector task hour cost.
  </Tab>

  <Tab title="Total cost">
    ```
    total_cost = storage_cost + partition_cost + ingress_cost + egress_cost + connect_cost
    ```

    Axes that aren't measurable for the cluster type contribute `0`. For example, a vanilla Kafka cluster with no Kafka Connect contributes only storage and partitions to its total.
  </Tab>
</Tabs>

<Warning>
  The accuracy of storage and partition metrics depends on the snapshot frequency. A shorter interval captures more granular usage; a longer interval may miss short-lived spikes.

  Deleting a cluster removes its Chargeback metrics.
</Warning>

## Update cost rates and labels

Click the settings (cog) icon at the top right of the **Chargeback** page to open the settings drawer:

* **General** tab: edit cost rates per cluster, or add a new cluster row
* **Chargeback Labels** tab: add or remove the label keys eligible for grouping

Both tabs save independently.

## Export data

Click **Export** in the filter bar to download the current view as a CSV. The export reflects the active **View by**, **Show** selections, **Period** and **Search**, so only data matching your current view is included.

The default file name is `Chargeback_<startDate>_<endDate>_<view>.csv`. The granularity of the exported series matches the selected period: 7D and 30D split by day, 6M, 12M and YTD split by month.

## Permissions

| Action                     | Required permission                                    |
| -------------------------- | ------------------------------------------------------ |
| View costs and drill-downs | **Can view Chargeback** (`PlatformChargebackView`)     |
| Set cost rates             | **Can manage Chargeback** (`PlatformChargebackManage`) |
| Select Chargeback Labels   | **Can manage Chargeback** (`PlatformChargebackManage`) |

Console shows cost attribution for all clusters regardless of the cluster-level permissions assigned to the user.

## Related resources

* [Chargeback concepts](/guide/conduktor-concepts/chargeback)
* [Configure Chargeback](/guide/tutorials/configure-chargeback)
* [Give us feedback/request a feature](https://conduktor.io/roadmap) <Icon icon="up-right-from-square" />
