Interface TraceSegment

All Known Implementing Classes:
TraceSegment.NoOp

public interface TraceSegment
A TraceSegment represents the local, i.e. in the scope of this Tracer, part of a a Trace. It can consist of multiple spans, and the TraceSegment instance can only be used in relation to the Span from which it was acquired. This means that the TraceSegment should not be stored and used at a later time, or passed around to async functions.
  • Method Details

    • setTagTop

      default void setTagTop(String key, Object value)
      Add a tag to the top of this TraceSegment.
      Parameters:
      key - key of the tag
      value - value of the tag
    • setTagTop

      void setTagTop(String key, Object value, boolean sanitize)
      Add a tag to the top of this TraceSegment with optional key sanitization.
      Parameters:
      key - key of the tag
      value - value of the tag
      sanitize - indicates is key need to be sanitized
    • getTagTop

      default Object getTagTop(String key)
      Get the tag value from the top of this TraceSegment.
      Parameters:
      key - key of the tag
    • getTagTop

      Object getTagTop(String key, boolean sanitize)
      Get the tag value from the top of this TraceSegment with optional key sanitization.
      Parameters:
      key - key of the tag
      sanitize - indicates is key need to be sanitized
    • setTagCurrent

      default void setTagCurrent(String key, Object value)
      Add a tag to the current span in this TraceSegment.
      Parameters:
      key - key of the tag
      value - value of the tag
    • setTagCurrent

      void setTagCurrent(String key, Object value, boolean sanitize)
      Add a tag to the current span in this TraceSegment. with optional key sanitization.
      Parameters:
      key - key of the tag
      value - value of the tag
      sanitize - indicates is key need to be sanitized
    • getTagCurrent

      default Object getTagCurrent(String key)
      Get the tag value from the current span in this TraceSegment.
      Parameters:
      key - key of the tag
    • getTagCurrent

      Object getTagCurrent(String key, boolean sanitize)
      Get the tag value from the current span in this TraceSegment. with optional key sanitization.
      Parameters:
      key - key of the tag
      sanitize - indicates is key need to be sanitized
    • setDataTop

      void setDataTop(String key, Object value)
      Add data to the top of this TraceSegment. The toString representation of the value must be valid top level JSON, i.e. an Object or an Array.
      Parameters:
      key - key of the data
      value - value of the data
    • getDataTop

      Object getDataTop(String key)
      Gets the value of the tag from the top of this TraceSegment.
      Parameters:
      key - key of the data
      Returns:
      value of the data
    • effectivelyBlocked

      void effectivelyBlocked()
      Mark the request as effectively blocked, by setting the tag appsec.blocked
    • setDataCurrent

      void setDataCurrent(String key, Object value)
      Add data to the current span in this TraceSegment. The toString representation of the value must be valid top level JSON, i.e. an Object or an Array.
      Parameters:
      key - key of the data
      value - value of the data
    • getDataCurrent

      Object getDataCurrent(String key)
      Gets the value of the tag from the current span in this TraceSegment.
      Parameters:
      key - key of the data
      Returns:
      value of the data
    • setMetaStructTop

      void setMetaStructTop(String field, Object value)
      Add a field to the meta_struct of the top of this TraceSegment.
      Parameters:
      field - field name
      value - value of the data
      See Also:
    • setMetaStructCurrent

      void setMetaStructCurrent(String field, Object value)
      Add a field to the current span meta_struct in this TraceSegment.
      Parameters:
      field - field name
      value - value of the data
      See Also:
      • invalid reference
        datadog.trace.common.writer.ddagent.TraceMapperV0_4.MetaStructWriter
      • invalid reference
        datadog.trace.core.CoreSpan#setMetaStruct(String, Object)