mtimbs / kafka-otel

Test environment for otel related kafka things - linking spans etc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kafka-otel

Given two services, I want to be able to link opentelemetry spans from the consumer to the producer. This example originally tried to use the opentelemetry-instrumentation-kafkajs package to instrument.

Due to what I can only assume is a massive skill issue I could not get it to work as expected. In the end I opted for manual instrumentation which is actually exceedingly easy and begs the question why auto-instrumentation even exists in the first place.

Buil and Run

To run this example app

docker-compose build

docker compose up

This will boot up

  • zookeeper
  • kafka (single broker)
  • producer app (producer/main.ts)
  • consumer app (consumer/main.ts)

Goal

Send a message from the producer app and see the span attributes for that message in the consumer app link to the producer span.

About

Test environment for otel related kafka things - linking spans etc

License:Apache License 2.0


Languages

Language:TypeScript 90.1%Language:Dockerfile 9.9%