4

I'm trying to introduce OpenTelemetry into our existing Quarkus-based (v 2.9.2.final) set of services. All services are written in a reactive way based on Mutiny. I'm failing to continue Spans or add events and attributes to them. I have configured Quarkus to produce traces into a locally running Otel collector with Zipkin and Jaeger.

Observations:

  • Quarkus creates Spans for every incoming REST request. I can add attributes here. Such span gets reported into Jaeger.
  • If I use @WithSpan annotation on a reactive method somewhere downstream - this span gets reported but without the link to the parent span created in the REST API
  • If I do not annotate the downstream reactive method and try to access and amend Span.current() I'm provided with the span created in the REST API abut any attribute or event addition is not propagated to Jaeger
  • If I try to inject OpenTelemetry Context bean - there is no such

Is there any working Quarkus OpenTelemetry reactive code sample? Or does Quarkus support OpenTelemetry just partially in non-reactive code?

  • Did you get it working? I have the same problem! – brunobastosg Sep 09 '22 at 20:05
  • 1
    Nope, I'm still waiting for the Quarkus team to implement proper trace context handling and propagation along the reactive pipelines and some sort of documentation or examples :-( – Jan Peremský Sep 12 '22 at 05:41
  • This issue is reported here in Quarkus Github repository : https://github.com/quarkusio/quarkus/issues/25453. I hope it will fixed someday. – Dorian Dec 08 '22 at 14:56

1 Answers1

1

Finally I found an inspiration in this Quarkus Superheroes demo - in the io.quarkus.sample.superheroes.statistics.listener.SuperStats class.

I tried to adapt it to be used with CosmosDB change feed processor and to also bridge Mutiny -> Reactor pipelines. I ended up with the helper Tracer class. It might help you.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 10 '22 at 13:52