MCPcopy Index your code
hub / github.com/DataDog/kafka-kit

github.com/DataDog/kafka-kit @v4.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.2.1 ↗ · + Follow
1,238 symbols 3,646 edges 131 files 569 documented · 46%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

testing

Kafka topic management tools

Read the blog post: Introducing Kafka-Kit: Tools for Scaling Kafka

This repository contains several services and tools for that help better operate Kafka. See the README for each tool for further details.

topicmappr

Topicmappr replaces and extends the kafka-reassign-partition tool bundled with Kafka. It allows for minimal movement broker replacements, cluster storage rebalancing / partition bin-packing, leadership optimization, many-at-once topic management, and more—all with rack awareness support.

README

registry

A gRPC+HTTP API service for Kafka that allows granular resource (topics, brokers) lookup and management with custom tagging support.

README

autothrottle

A service that automatically paces Kafka replication/recovery throttle rates, powered with metrics using the Datadog API.

README

metricsfetcher

A utility that fetches metrics via the Datadog API for Kafka storage rebalancing and partition mapping with topicmappr.

README

Building

All tools/services will likely build on recent versions of MacOS and Go: go install ./cmd/....

A Docker based environment is available for repeatable linux builds and local testing. This will setup a Kafka environment with a running Registry instance from which all other Kafka-Kit tools will be available:

$ make run-compose
docker-compose build
zookeeper uses an image, skipping
kafka uses an image, skipping
Building ssl_setup
[+] Building 0.5s (15/15) FINISHED
[...build output...]

$ docker exec -ti kafka-kit_registry_1 bash
root@280ae6597b9b:/go/src/github.com/DataDog/kafka-kit# which topicmappr registry autothrottle metricsfetcher
/go/bin/topicmappr
/go/bin/registry
/go/bin/autothrottle
/go/bin/metricsfetcher

root@280ae6597b9b:/go/src/github.com/DataDog/kafka-kit# curl -s localhost:8080/v1/topics/list | jq
{
  "topics": {},
  "names": [
    "__consumer_offsets"
  ]
}

When finished, make stop-compose will tear down the environment.

Development

See the Development Guide for testing and contributing changes.

Extension points exported contracts — how you extend this code

TagStorage (Interface)
TagStorage handles tag persistence to stable storage. [2 implementers]
registry/server/tag.go
KafkaAdmin (Interface)
KafkaAdmin interface. [2 implementers]
kafkaadmin/kafkaadmin.go
SimpleZooKeeperClient (Interface)
SimpleZooKeeperClient is an interface that wraps a real ZooKeeper client, obscuring much of the API semantics that are u [2 …
kafkazk/zookeeper.go
Lock (Interface)
Lock defines a distributed locking service. [2 implementers]
cluster/cluster.go
ZooKeeperClient (Interface)
ZooKeeperClient interface. [1 implementers]
cluster/zookeeper/zookeeper.go
PartitionMapOpt (FuncType)
PartitionMapOpt is a function that configures a *PartitionMap at instantiation time.
mapper/partitions.go
BrokerFilterFn (FuncType)
BrokerFilterFn is a filter function for BrokerList and BrokerMap types.
mapper/brokers.go
BrokerOverridesFilterFn (FuncType)
BrokerOverridesFilterFn specifies a filter function.
cmd/autothrottle/internal/throttlestore/brokers.go

Core symbols most depended-on inside this repo

Error
called by 78
kafkazk/zookeeper_errors.go
Error
called by 70
mapper/mappings.go
Equal
called by 61
registry/server/tag.go
PartitionMapFromString
called by 34
mapper/partitions.go
Error
called by 27
registry/server/tag.go
Equal
called by 26
mapper/partitions.go
SetTags
called by 25
registry/server/tag.go
Error
called by 23
cluster/zookeeper/errors.go

Shape

Method 590
Function 471
Struct 118
TypeAlias 44
Interface 11
FuncType 4

Languages

Go100%

Modules by API surface

registry/registry/registry.pb.go136 symbols
registry/registry/registry_grpc.pb.go95 symbols
kafkazk/zookeeper.go60 symbols
mapper/partitions.go44 symbols
mapper/brokers.go41 symbols
registry/registry/registry.pb.gw.go38 symbols
kafkazk/zookeeper_integration_test.go34 symbols
kafkazk/zookeeper_stub.go31 symbols
registry/server/tag.go29 symbols
mapper/partitions_test.go24 symbols
mapper/stats.go18 symbols
registry/server/server.go17 symbols

For agents

$ claude mcp add kafka-kit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact