Class StackdriverTracePropagation

java.lang.Object
brave.propagation.stackdriver.StackdriverTracePropagation
All Implemented Interfaces:
brave.propagation.Propagation<String>

public class StackdriverTracePropagation extends Object implements brave.propagation.Propagation<String>
Stackdriver Trace propagation.

Tries to extract a trace ID and span ID using the B3 key set, such as X-B3-TraceId, X-B3-SpanId, etc. If not present, tries the x-cloud-trace-context key.

Uses B3Propagation injection, to inject the tracing context using B3 headers.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface brave.propagation.Propagation

    brave.propagation.Propagation.Getter<R extends Object,K extends Object>, brave.propagation.Propagation.KeyFactory<K extends Object>, brave.propagation.Propagation.RemoteGetter<R extends Object>, brave.propagation.Propagation.RemoteSetter<R extends Object>, brave.propagation.Propagation.Setter<R extends Object,K extends Object>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    128 trace ID lower-hex encoded into 32 characters (required)

    Fields inherited from interface brave.propagation.Propagation

    B3_SINGLE_STRING, B3_STRING
  • Method Summary

    Modifier and Type
    Method
    Description
    <R> brave.propagation.TraceContext.Extractor<R>
    extractor(brave.propagation.Propagation.Getter<R,String> getter)
     
    <R> brave.propagation.TraceContext.Injector<R>
    injector(brave.propagation.Propagation.Setter<R,String> setter)
     
     
    static brave.propagation.Propagation.Factory
    newFactory(brave.propagation.Propagation.Factory primary)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TRACE_ID_NAME

      public static final String TRACE_ID_NAME
      128 trace ID lower-hex encoded into 32 characters (required)
      See Also:
  • Method Details

    • newFactory

      public static brave.propagation.Propagation.Factory newFactory(brave.propagation.Propagation.Factory primary)
      Parameters:
      primary - typically constructed by B3Propagation.newFactoryBuilder()
    • keys

      public List<String> keys()
      Specified by:
      keys in interface brave.propagation.Propagation<String>
    • injector

      public <R> brave.propagation.TraceContext.Injector<R> injector(brave.propagation.Propagation.Setter<R,String> setter)
      Specified by:
      injector in interface brave.propagation.Propagation<String>
    • extractor

      public <R> brave.propagation.TraceContext.Extractor<R> extractor(brave.propagation.Propagation.Getter<R,String> getter)
      Specified by:
      extractor in interface brave.propagation.Propagation<String>