Class TraceHeader

java.lang.Object
com.amazonaws.xray.entities.TraceHeader

public class TraceHeader
extends java.lang.Object
  • Field Details

  • Constructor Details

    • TraceHeader

      public TraceHeader()
    • TraceHeader

      public TraceHeader​(@Nullable TraceID rootTraceId)
    • TraceHeader

      public TraceHeader​(@Nullable TraceID rootTraceId, @Nullable java.lang.String parentId)
    • TraceHeader

      public TraceHeader​(@Nullable TraceID rootTraceId, @Nullable java.lang.String parentId, TraceHeader.SampleDecision sampled)
  • Method Details

    • fromString

      public static TraceHeader fromString​(@Nullable java.lang.String string)
      Creates a TraceHeader object from a String. Note that this will silently ignore any "Self=" trace ids injected from ALB.
      Parameters:
      string - the string from an incoming trace-id header
      Returns:
      the TraceHeader object
    • toString

      public java.lang.String toString()
      Serializes the TraceHeader object into a String.
      Overrides:
      toString in class java.lang.Object
      Returns:
      the String representation of this TraceHeader
    • getRootTraceId

      public @Nullable TraceID getRootTraceId()
      Returns:
      the rootTraceId
    • setRootTraceId

      public void setRootTraceId​(TraceID rootTraceId)
      Parameters:
      rootTraceId - the rootTraceId to set
    • getParentId

      public @Nullable java.lang.String getParentId()
      Returns:
      the parentId
    • setParentId

      public void setParentId​(java.lang.String parentId)
      Parameters:
      parentId - the parentId to set
    • getSampled

      public TraceHeader.SampleDecision getSampled()
      Returns:
      the sampled
    • setSampled

      public void setSampled​(TraceHeader.SampleDecision sampled)
      Sets the sample decision.
      Parameters:
      sampled - the non-null SampleDecision to set
      Throws:
      java.lang.IllegalArgumentException - if sampled is null
    • getAdditionalParams

      public java.util.Map<java.lang.String,​java.lang.String> getAdditionalParams()
      Returns:
      the additionalParams
    • setAdditionalParams

      public void setAdditionalParams​(java.util.Map<java.lang.String,​java.lang.String> additionalParams)
      Parameters:
      additionalParams - the additionalParams to set
    • putAdditionalParam

      public void putAdditionalParam​(java.lang.String key, java.lang.String value)
      Puts an additional parameter into the additionalParam map.
      Parameters:
      key - the key to put into
      value - the value to put