Topic Rules
Topic Rules
Topic Rules are applied to Kafka topics matching a specified pattern. They define constraints on topics and their lifecycle.
These rules are configured as part of a Policy. Click Add Topic Rules to add a pattern group. Multiple pattern groups can be added to apply different rules to different sets of topics within the same policy.
Pattern Groups
Each group of topic rules is scoped to a Topic Pattern — a regex that matches the topic names this group applies to. Use * to match all topics.
The following rule types can be added to each pattern group.
Naming
Topics must match this pattern — when enabled, topic names must conform to the group's topic pattern. Topics with non-conforming names are treated as a violation.
Description — a human-readable label describing the naming convention, presented in the telemetry event when a violation occurs.
| Field | Example value | Effect |
|---|---|---|
| Topic Pattern | prod\..+ | Matches all topics prefixed with prod. |
Partition Rules
Constrains the number of partitions a topic can have and how many can be added at once.
| Field | Description | Example value | Effect |
|---|---|---|---|
| Min Partitions | Minimum number of partitions required | 3 | Topics must have at least 3 partitions |
| Max Partitions | Maximum number of partitions allowed | 30 | Topics cannot exceed 30 partitions |
| Max Partition Increase | Maximum number of partitions that can be added in a single alter operation | 5 | A single alter request can add at most 5 partitions |
Replica Rules
Constrains the replication factor for matching topics.
| Field | Description | Example value | Effect |
|---|---|---|---|
| Min Replicas | Minimum replication factor required | 2 | Prevents single-replica topics from being created |
| Max Replicas | Maximum replication factor allowed | 3 | Topics cannot be created with more than 3 replicas |
Configuration Rules
Controls which topic-level configuration keys are permitted and what defaults are applied.
Allowed Configs
A list of topic configuration keys that are permitted to be set. Any key not in this list cannot be configured on matching topics.
| Topic pattern | Example value | Effect |
|---|---|---|
_internal\..+ | cleanup.policy, retention.ms | Only these two keys can be set on internal topics; all others are rejected |
Delete Rules
Allow topic deletion — controls whether matching topics can be deleted. When disabled, delete requests for matching topics are treated as a violation.