A Guide to Enabling Tracing in Spring Boot 3 and Kafka

Ruhshan Ahmed Abir
Javarevisited
Published in
8 min readMay 14, 2024

Just my bi-cycle and some grass

Use this link to access the whole story for free

In today’s complex and interconnected software ecosystems, tracing has become an indispensable tool for understanding and optimizing system performance. When it comes to distributed systems like those built with Spring Boot and Kafka, effective tracing can be the key to unlocking insights into how data flows through our applications. In this article, we’ll provide a guide to enabling tracing in Spring Boot applications integrated with Kafka. By the end, you’ll have the tools and knowledge to implement tracing effectively, enhancing the observability and performance of your distributed systems.

We will modify the code from this article: “Tracing in spring boot 3

We will create a producer and consumer, in two different apps. Then see how to propagate the trace id between them.

The flow will be RestApiApplication → RestApi2Application → KafkaConsumerApplication

Before everything we need a kafka instance for our development purpose. Here is a docker compose for that:

version: '2'
services:
zookeeper:
container_name: tracing-demo-zookeeper
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Ruhshan Ahmed Abir
Javarevisited

Started with poetry, ended up with codes. Have a university degree on Biotechnology. Works and talks about Java, Python, JS. www.buymeacoffee.com/ruhshan