Package 

Interface DatadogPropagation


  • 
    public interface DatadogPropagation
    
                        

    Provides an interface for injecting and extracting span context to/from specified carriers. Used for propagating context to http headers.

    • Method Summary

      Modifier and Type Method Description
      abstract <C extends Any> Unit inject(DatadogSpanContext context, C carrier, Function3<C, String, String, Unit> setter) Injects the span context into a specified carrier using the provided setter function.
      abstract <C extends Any> DatadogSpanContext extract(C carrier, Function2<C, Function2<String, String, Boolean>, Unit> getter) Extracts a DatadogSpanContext from the provided carrier using the specified getter function.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • inject

         abstract <C extends Any> Unit inject(DatadogSpanContext context, C carrier, Function3<C, String, String, Unit> setter)

        Injects the span context into a specified carrier using the provided setter function. This method facilitates the propagation of trace information across process boundaries or systems by embedding relevant span context data into the carrier.

        Parameters:
        context - The DatadogSpanContext containing the trace and span information to inject.
        carrier - The carrier object where the trace information will be injected.
        setter - A function used to set key-value pairs into the carrier.
      • extract

         abstract <C extends Any> DatadogSpanContext extract(C carrier, Function2<C, Function2<String, String, Boolean>, Unit> getter)

        Extracts a DatadogSpanContext from the provided carrier using the specified getter function. This method is used to propagate Datadog span context information across systems by retrieving trace and span information from the carrier.

        Parameters:
        carrier - The carrier object from which the span context will be extracted.
        getter - A function that retrieves key-value pairs from the carrier, using a classifier function to match desired key-value pairs.