Module brave

Class B3SinglePropagation<K>

  • All Implemented Interfaces:
    Propagation<K>

    public final class B3SinglePropagation<K>
    extends java.lang.Object
    implements Propagation<K>
    Implements the propagation format described in B3SingleFormat.
    • Method Detail

      • keys

        public java.util.List<K> keys()
        Description copied from interface: Propagation
        The propagation fields defined. If your carrier is reused, you should delete the fields here before calling Propagation.Setter.put(Object, Object, String).

        For example, if the carrier is a single-use or immutable request object, you don't need to clear fields as they couldn't have been set before. If it is a mutable, retryable object, successive calls should clear these fields first.

        Note: If your implementation carries "extra fields", such as correlation IDs, do not return the names of those fields here. If you do, they will be deleted, which can interfere with user headers.

        Specified by:
        keys in interface Propagation<K>
      • injector

        public <C> TraceContext.Injector<C> injector​(Propagation.Setter<C,​K> setter)
        Description copied from interface: Propagation
        Replaces a propagated field with the given value. Saved as a constant to avoid runtime allocations. For example, a setter for an HttpURLConnection would be the method reference URLConnection.addRequestProperty(String, String)
        Specified by:
        injector in interface Propagation<K>
        Parameters:
        setter - invoked for each propagation key to add.