Skip to main content

Overview

This feature is available with Conduktor Scale Plus only.
Chargeback with Gateway (previously known as Chargeback) allows organizations to track and allocate costs/usage associated with Kafka resources to different teams or departments based on the data they consume and process to facilitate cost accountability and management.

Prerequisites

Chargeback with Gateway requires both Console (v1.29.0 and above) and Gateway (v3.4.0 and above). If you’re using Console v1.41.0 or above, you’ll need to enable the Chargeback feature flag to use this functionality:
Environment variableTypeDefaultDescription
CDK_CHARGEBACKV2_ENABLEDBooleanfalseSet to true to enable Chargeback with and without Gateway

Enable Chargeback with Gateway in Console

  1. Enable the feature flag before starting Console:
    export CDK_CHARGEBACKV2_ENABLED=true
    
  2. Go to Settings > Clusters and select your cluster.
  3. In the Provider tab, select Gateway and enter the API details with the default Virtual Cluster value of passthrough. Gateway provider
  4. Deploy the Chargeback with Gateway 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
  }
}'
After a few minutes, you should see your active service accounts appear on the Chargeback with Gateway in Console.

Chargeback with Gateway Interceptor

This Interceptor monitors produce and consume requests to store metrics about incoming and outgoing traffic (bytes) in a topic. Console uses this topic to display Chargeback with Gateway.

Configure Chargeback with Gateway Interceptor

NameTypeDefaultDescription
topicNameStringTopics used to store observability metrics. If this topic already exists in your cluster, it has to have only one partition. If the topic doesn’t exist, Gateway will create it when you deploy the plugin.
replicationFactorIntThe replication factor to set if Gateway needs to create the topic.
flushIntervalInSecondInt300The periodic interval for flushing metrics to the specified topic.