Module brave

Class CorrelationFieldScopeDecorator

  • All Implemented Interfaces:
    CurrentTraceContext.ScopeDecorator

    public abstract class CorrelationFieldScopeDecorator
    extends java.lang.Object
    implements CurrentTraceContext.ScopeDecorator
    Adds correlation properties "traceId", "parentId", "spanId" and "sampled" when a span is current. "traceId" and "spanId" are used in log correlation. "parentId" is used for scenarios such as log parsing that reconstructs the trace tree. "sampled" is used as a hint that a span found in logs might be in Zipkin.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      CurrentTraceContext.Scope decorateScope​(TraceContext currentSpan, CurrentTraceContext.Scope scope)
      When the input is not null "traceId", "parentId", "spanId" and "sampled" correlation properties are saved off and replaced with those of the current span.
      protected abstract java.lang.String get​(java.lang.String key)
      Returns the correlation property of the specified name iff it is a string, or null otherwise.
      protected abstract void put​(java.lang.String key, java.lang.String value)
      Replaces the correlation property of the specified name
      protected abstract void remove​(java.lang.String key)
      Removes the correlation property of the specified name
      • Methods inherited from class java.lang.Object

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

      • CorrelationFieldScopeDecorator

        public CorrelationFieldScopeDecorator()
    • Method Detail

      • get

        @Nullable
        protected abstract java.lang.String get​(java.lang.String key)
        Returns the correlation property of the specified name iff it is a string, or null otherwise.
      • put

        protected abstract void put​(java.lang.String key,
                                    java.lang.String value)
        Replaces the correlation property of the specified name
      • remove

        protected abstract void remove​(java.lang.String key)
        Removes the correlation property of the specified name