10.8.4 – Operational Best Practices
Module: Section 10 – Kafka Ecosystem & Tools
Section: 10.8 – ksqlDB in Production
Goal: Production operational best practices
Monitoring
Key Metrics:
- Query processing rate
- State store size
- Rebalance frequency
- Error rate
JMX Metrics:
kafka.streams:type=stream-metrics
kafka.streams:type=stream-task-metrics
Logging
Enable debug logging:
log4j.logger.io.confluent.ksql=DEBUG
Key log files:
ksqldb-server.log- Server logsksqldb-queries.log- Query execution logs
Query Management
List queries:
SHOW QUERIES;
Terminate query:
TERMINATE query_id;
Explain query:
EXPLAIN SELECT * FROM orders EMIT CHANGES;
Troubleshooting Checklist
- Check ksqlDB server logs
- Verify Kafka connectivity
- Check state store disk space
- Monitor rebalancing frequency
- Review query execution plans
Key Takeaways
- Monitor: JMX metrics, query rate, state size
- Logging: Enable DEBUG for troubleshooting
- Query Management: SHOW, TERMINATE, EXPLAIN
- Troubleshooting: Systematic checklist
What's Next?
Next Module: 10.9 – Kafka REST Proxy