How do I get a brave.Tracing from a micrometer Tracer?

69 views Asked by At

I want to add Redis tracing into Lettuce which only supports Brave from what I can tell.

So I want to get this code

@Bean(destroyMethod = "shutdown")
fun lettuceClientResources(): ClientResources {

    return DefaultClientResources.builder()
        .tracing(BraveTracing.create(**NOT SURE WHAT TO DO HERE**))
        .build()
}

I tried

  • Tracing.current()
  • Injecting a brave.Tracing doesn't exist
1

There are 1 answers

0
Archimedes Trajano On

Just searched around the source code and found another class that does what I needed

@Bean(destroyMethod = "shutdown")
fun lettuceClientResources(observationRegistry: ObservationRegistry): ClientResources = DefaultClientResources.builder()
  .tracing(MicrometerTracingAdapter(observationRegistry, "redis"))
  .build()