Skip to main content

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.

Overview

This tutorial sets up Chargeback in Console, including the optional sources required for ingress and egress metrics:
  • Confluent Cloud throughput — calls the Confluent Cloud Metrics API hourly
  • Gateway throughput — relies on the observability Interceptor deployed on Gateway
For background on the cost axes and the metrics available per cluster type, see Chargeback concepts.

Prerequisites

RequirementDetails
Consolev1.45.0 or above
Gateway (optional)v3.4.0 or above, required only for Gateway throughput
Confluent Cloud (optional)API key with Metrics API access, required only for Confluent Cloud throughput
PermissionsPlatformChargebackManage to set cost rates and configure Chargeback Labels

Environment variables

Set these on Console before starting it.
Environment variableTypeDefaultDescription
CDK_CHARGEBACKV2_ENABLEDBooleanfalseSet to true to enable Chargeback
CDK_CHARGEBACKV2_METRICSUPDATEFREQUENCYLong (seconds)3600How often Console snapshots topic storage and partition counts
CDK_CHARGEBACK_FLUSHMETRICSEVERYSECONDSLong (seconds)300How often Gateway throughput is flushed from the observability stream into the Chargeback tables
CDK_CHARGEBACK_CCTHROUGHPUT_ENABLEDBooleantrueSet to false to skip Confluent Cloud throughput collection
CDK_CHARGEBACK_CCTHROUGHPUT_FREQUENCYSECONDSLong (seconds)3600How often the Confluent Cloud Metrics API is queried for throughput
The same CDK_CHARGEBACKV2_ENABLED flag is used by the Chargeback feature regardless of cluster type.

Enable Chargeback in Console

1

Set the feature flag

export CDK_CHARGEBACKV2_ENABLED=true
2

Start or restart Console

After Console is running, Chargeback appears in the left navigation.
3

Run the onboarding wizard

Open the Chargeback page. As an administrator, you’ll be guided through:
  1. Setting the per-cluster unit costs (storage, partitions, ingress, egress)
  2. Selecting which label keys are eligible as Chargeback Labels
Both steps can be revisited later from the settings (cog) icon on the Chargeback page.
After the first collection tick, the Chargeback page begins displaying data.

Collect Gateway throughput

Ingress and egress for Gateway clusters are produced by the observability Interceptor running on Gateway. If you only need storage and partition metrics for Gateway clusters, you can skip this section.
1

Connect Gateway to Console

In Console, go to Settings > Clusters and select your cluster. In the Provider tab, select Gateway and enter the Gateway API details with the Virtual Cluster value of passthrough.Gateway provider
2

Deploy the observability Interceptor on Gateway

curl \
  --request PUT \
  --url 'http://localhost:8888/gateway/v2/interceptor' \
  --header 'Authorization: Basic YWRtaW46Y29uZHVrdG9y' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "name": "observability-interceptor",
  "pluginClass": "io.conduktor.gateway.interceptor.observability.ObservabilityPlugin",
  "priority": 100,
  "config": {
    "topicName": "_conduktor_observability",
    "replicationFactor": 3,
    "flushIntervalInSecond": 300
  }
}'

Observability Interceptor reference

NameTypeDefaultDescription
topicNameStringTopic used to store observability metrics. If the topic exists, it has to have only one partition. If it doesn’t exist, Gateway creates it.
replicationFactorIntReplication factor used when Gateway creates the topic.
flushIntervalInSecondInt300Frequency at which metrics are flushed to the topic.

Collect Confluent Cloud throughput

Confluent Cloud ingress and egress are pulled hourly through the Confluent Cloud Metrics API. Collection is on by default. To enable collection on a cluster, configure the cluster in Console with API credentials that include Metrics API access. No further setup is needed. To turn collection off globally, set:
export CDK_CHARGEBACK_CCTHROUGHPUT_ENABLED=false

Verify

1

Wait for the first collection tick

Storage and partition metrics appear after the first snapshot (default: one hour). Confluent Cloud throughput appears after the first hourly tick. Gateway throughput appears once the observability Interceptor has flushed to the metrics topic (default: every five minutes).
2

Open the Chargeback page

Cluster rows show non-zero values for the axes that match the cluster type.
3

Check cost configuration

Click the settings (cog) icon at the top right of the Chargeback page. Confirm that all clusters that should appear are listed with the expected unit costs.
Console begins collecting metrics immediately after the feature flag is set, but data only appears after the first collection interval.