Skip to content

Kafka Streams tracing no longer working after upgrading to Spring Boot 3 + Micrometer Tracing #2635

Open
@j-tim

Description

@j-tim

Context

At the moment I'm migrating some Spring Boot 2.7.x, Spring for Apache Kafka applications to Spring Boot 3.

I followed the migration guide and Spring Kafka documentation regarding migrating from Spring Cloud Sleuth to Micrometer Tracing

Distributed tracing works fine for:

  • producing to Kafka (by enabling observation on the KafkaTemplate)
  • and consuming from Kafka (by enabling observation via the container properties of the KafkaListenerContainerFactory)

But for Kafka streams application (using the KafkaStreamBrancher in my minimal, reproducible, sample) the tracing is no longer working after the upgrade.

In what version(s) of Spring for Apache Kafka are you seeing this issue?

Spring for Apache Kafka: 3.0.4

Migrating from:

  • Spring Boot 2.7.9
    • Spring Cloud: 2021.0.6
    • Spring for Apache Kafka: 2.8.11
    • Spring Cloud Sleuth

to:

  • Spring Boot 3.0.4
    • Spring Cloud: 2022.0.1
    • Spring for Apache Kafka: 3.0.4
    • Micrometer Tracing (Open Telemetry + Zipkin)

Describe the bug

For the Kafka streams application the tracing is no longer working after the upgrade.

Spring Boot 2.7.9, Spring Kafka and Spring Cloud Sleuth:

Spring Boot 3.0.4, Spring Kafka and Micrometer Tracing (OTEL)

Expected behavior

I expect the traces of my Kafka Streams application are reported in this case to Zipkin.

Sample to reproduce the issue

I put some effort in creating a GitHub repository with a minimal, reproducible, sample to reproduce the issue. The README of the sample project contains all the step to reproduce the issue.

Branches in the example repository:

  • main: branch that contains the example to reproduce the issue with Spring Boot 3.0.4, Spring Kafka and Micrometer Tracing
  • spring-boot-2.7-spring-cloud-sleuth: branch that contains a fully working example based on Spring Boot 2.7.9 and Spring Cloud Sleuth

Did I overlook something in the documentation to enable tracing for my Kafka Streams application? Or is tracing for Kafka Stream applications not supported yet using Spring for Apache Kafka and Micrometer Tracing?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions