Skip to content

Watch a Kafka system

In this tutorial, you start a small order system that uses a real broker. The broker is Redpanda, which uses the Kafka protocol. You follow one order across its topics. Then you start a fault and see it on the timeline.

You need Docker and Git. You do not need to install streamview or Node.js.

Get the streamview source code, and start the example:

git clone https://github.com/event-catalog/streamview
cd streamview/example
docker compose up -d --build

The first build takes some minutes. The command starts a broker, six services, and streamview.

Open http://localhost:4747 in your browser.

You see one lane for each topic, for example orders.placed and payments.captured. The six services send messages only through these topics.

  1. Click the time range button at the top right. Then click Last 30 s.
  2. Drag across approximately three seconds of the timeline. Each event is now one thin mark.
  3. Click a mark in the orders.placed lane.

The panel opens. The trace shows the events of this order in the other topics. The value next to each step is the time after the first event.

The services send plain JSON messages, not CloudEvents. streamview connects the messages with the orderId field of each message.

  1. Press Escape to close the panel.
  2. Click Live. The view follows the current time again.
  3. Run this command in a terminal:
curl -X POST 'localhost:18081/chaos/outage?seconds=60'
  1. Look at the payments.authorized lane and the payments.captured lane for two minutes.

For 60 seconds, the payments service cannot get an answer from its payment gateway. The two lanes become empty, but orders.placed continues. When the outage ends, the two lanes show a burst, because the payments service handles the orders that waited.

  1. Run this command:
curl -X POST 'localhost:18080/chaos/bad-deploy?seconds=45'
  1. Look at the orders.placed lane.

For 45 seconds, the orders service sends total as text. streamview shows these events in amber, because their shape is different from the usual shape.

  1. Click an amber mark.

The panel shows the label Shape drift and the field that is different.

Run this command in the example directory:

docker compose down -v

The command stops the containers and deletes their data.

You saw a real Kafka system on the timeline, followed one order, and saw two faults when they occurred.

Next steps: