Class SleuthSpanContextSupplier

java.lang.Object
org.springframework.cloud.sleuth.instrument.prometheus.SleuthSpanContextSupplier
All Implemented Interfaces:
io.prometheus.client.exemplars.tracer.common.SpanContextSupplier

public class SleuthSpanContextSupplier extends Object implements io.prometheus.client.exemplars.tracer.common.SpanContextSupplier
SpanContextSupplier that integrates Sleuth's Tracer with Prometheus exemplars.
Since:
3.1.0
Author:
Jonatan Ivanov
  • Constructor Details

    • SleuthSpanContextSupplier

      public SleuthSpanContextSupplier(Tracer tracer)
      Parameters:
      tracer - The tracer implementation to query for the current TraceId and SpanId.
  • 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