Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Kafka Difficulty: Advanced ClaudeChatGPTCursor

Kafka Connect Pipeline Debugging & Tuning Prompt

Diagnose a failing or lagging Kafka Connect pipeline — dead or restarting tasks, DLQ growth, offset stalls, and rebalance churn — then prescribe connector, converter, and worker tuning that is safe to roll out.

Target user
Data platform and SRE engineers
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior Kafka engineer triaging a Kafka Connect pipeline in distributed mode, producing a root-cause analysis and a remediation plan to review before any change is applied.

I will provide:
- Connector context: source or sink connector class, number of tasks, `tasks.max`, and the topics involved
- Health signals: connector/task state from the REST API (`RUNNING`, `FAILED`, `PAUSED`), task restart counts, and the stack trace on the failed task
- Throughput picture: source poll rate vs. sink write rate, consumer lag on the sink connector's group, and whether the DLQ topic is growing
- Converter and schema setup: key/value converters (JSON, Avro, Protobuf), Schema Registry usage, and any recent schema change
- Worker signals: worker count, `offset.flush.interval.ms`, `offset.flush.timeout.ms`, rebalance frequency in the worker logs, and CPU/heap on the workers

Your job:

1. **Classify the failure** — separate a hard `FAILED` task (fatal exception, task stopped) from a soft problem (task `RUNNING` but lagging, DLQ filling, or offsets not committing), because the two need different fixes.
2. **Read the stack trace precisely** — attribute a failed task to its real cause: a converter/serialization mismatch, a schema-compatibility break, a downstream sink timeout or auth error, or a poison record — and say which.
3. **Assess error tolerance** — check whether `errors.tolerance`, `errors.deadletterqueue.topic.name`, and retry settings are configured so a single poison record routes to the DLQ instead of killing the task, and recommend the right policy.
4. **Diagnose task parallelism** — verify effective task count against `tasks.max` and source partitioning (a source connector cannot exceed its natural parallelism), and identify skew where one task carries most of the load.
5. **Diagnose offset and flush health** — determine whether stalled offset commits come from a slow sink, an undersized `offset.flush.timeout.ms`, or worker rebalance churn interrupting flushes.
6. **Stabilize worker rebalances** — check whether frequent worker group rebalances (incremental cooperative vs. eager) are restarting tasks, and recommend `scheduled.rebalance.max.delay.ms` and worker-sizing changes.
7. **Prescribe the fix** — give an ordered plan: quarantine poison records to the DLQ, correct converter/schema config, right-size `tasks.max`, tune flush/retry, and only then scale workers.

Output: (a) failure classification, (b) stack-trace root cause, (c) error-tolerance/DLQ assessment, (d) parallelism and offset-flush analysis, (e) rebalance stabilization, (f) prioritized remediation plan with the specific connector/worker configs to change.

Advisory only; validate connector config changes with the REST API validate endpoint and roll out on one connector before applying fleet-wide.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Kafka prompts & error guides

Browse every Kafka prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.