with-tracing

command
v1.8.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 13 Imported by: 0

README

Distributed Tracing

segmentio/kafka-go has no support for open telemetry. There is also an issue about it. Based on some work on that issue, we created a project called otel-kafka-konsumer.

By integrating this project with kafka-konsumer, we successfully implemented distributed tracing in consuming and producing operations. You can run demo.

In this demo, we chose jaeger to show how to integrate distributed tracing on your project using kafka-konsumer. But zipkin, stdout, and other alternatives are still applicable

Two settings are significant.

  • trace.TracerProvider (you can set jaeger,zipkin etc.)
  • propagation.TextMapPropagator (please refer to here)

If you have not specified its values, kafka-konsumer uses global.TraceProvider and Propagation.

Demo overview

Tracing Example

How to run demo?

You should run docker-compose.yml by

docker-compose up build

You can access the jaeger dashboard as jaeger dashboard

You can run the demo as go run main.go

In the producing step, we open only two spans. In the consuming step, we open three spans. You can see their relationship via the jeager dashboard, as shown below.

Demo Jeager

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL