Class LazySleuthSpanContextSupplier

java.lang.Object
org.springframework.cloud.sleuth.instrument.prometheus.LazySleuthSpanContextSupplier
All Implemented Interfaces:
io.prometheus.client.exemplars.tracer.common.SpanContextSupplier, org.springframework.beans.factory.SmartInitializingSingleton

public class LazySleuthSpanContextSupplier extends Object implements io.prometheus.client.exemplars.tracer.common.SpanContextSupplier, org.springframework.beans.factory.SmartInitializingSingleton
A SpanContextSupplier that fetches the Tracer lazily after singletons are instantiated and uses it onwards.
Author:
Jonatan Ivanov
  • Constructor Details

    • LazySleuthSpanContextSupplier

      public LazySleuthSpanContextSupplier(org.springframework.beans.factory.ObjectProvider<Tracer> tracerProvider)
  • Method Details

    • getTraceId

      public String getTraceId()
      Specified by:
      getTraceId in interface io.prometheus.client.exemplars.tracer.common.SpanContextSupplier
    • getSpanId

      public String getSpanId()
      Specified by:
      getSpanId in interface io.prometheus.client.exemplars.tracer.common.SpanContextSupplier
    • afterSingletonsInstantiated

      public void afterSingletonsInstantiated()
      Specified by:
      afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton