Skip to main content

Overview

Chargeback enables organizations to track and allocate costs associated with Kafka topics by tracking storage and partition use. This feature, introduced in Console v1.41.0 does not require Gateway (unlike Chargeback with Gateway). It collects metrics directly from Console’s metadata indexer which queries topic and partition information from your clusters.

Prerequisites

Chargeback without Gateway requires Console (v1.41.0 or above).

Environment variables

Environment variableTypeDefaultDescription
CDK_CHARGEBACKV2_ENABLEDBooleanfalseSet to true to enable Chargeback with and without Gateway
CDK_CHARGEBACKV2_METRICSUPDATEFREQUENCYLong (seconds)3600Frequency of metrics collection (default: 1 hour)
The frequency determines how often metrics are collected from clusters. Considerations:
  • Lower frequency (e.g., 30 minutes): more granular data, higher resource usage
  • Higher frequency (e.g., two hours): less granular data, lower resource usage
  • Default: one hour

Enable Chargeback without Gateway in Console

  1. Enable the feature flag and optionally set the metrics update frequency.
Set the feature flag before starting Console:
export CDK_CHARGEBACKV2_ENABLED=true
export CDK_CHARGEBACKV2_METRICSUPDATEFREQUENCY=3600  # optional, default 1 hour
  1. Configure cost rates.
Once enabled, you can configure cost rates per cluster, by clicking on the gear icon in the top right. Chargeback for storage and partitions graph
  1. Grant user permissions.
Ensure users who need access have the PlatformChargebackManage permission assigned. Console shows all cluster cost attribution regardless of whether the user has access to that cluster.
Console begins collecting metrics immediately after enabling, but data will only appear after the first collection interval (default: one hour).