public interface TraceSegment
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.| Modifier and Type | Interface and Description |
|---|---|
static class |
TraceSegment.NoOp |
| Modifier and Type | Method and Description |
|---|---|
void |
effectivelyBlocked()
Mark the request as effectively blocked, by setting the tag appsec.blocked
|
Object |
getDataCurrent(String key)
Gets the value of the tag from the current span in this
TraceSegment. |
Object |
getDataTop(String key)
Gets the value of the tag from the top of this
TraceSegment. |
default Object |
getTagCurrent(String key)
Get the tag value from the current span in this
TraceSegment. |
Object |
getTagCurrent(String key,
boolean sanitize)
Get the tag value from the current span in this
TraceSegment. |
default Object |
getTagTop(String key)
Get the tag value from the top of this
TraceSegment. |
Object |
getTagTop(String key,
boolean sanitize)
Get the tag value from the top of this
TraceSegment with optional key sanitization. |
void |
setDataCurrent(String key,
Object value)
Add data to the current span in this
TraceSegment. |
void |
setDataTop(String key,
Object value)
Add data to the top of this
TraceSegment. |
void |
setMetaStructCurrent(String field,
Object value)
Add a field to the current span meta_struct in this
TraceSegment. |
void |
setMetaStructTop(String field,
Object value)
Add a field to the meta_struct of the top of this
TraceSegment. |
default void |
setTagCurrent(String key,
Object value)
Add a tag to the current span in this
TraceSegment. |
void |
setTagCurrent(String key,
Object value,
boolean sanitize)
Add a tag to the current span in this
TraceSegment. |
default void |
setTagTop(String key,
Object value)
Add a tag to the top of this
TraceSegment. |
void |
setTagTop(String key,
Object value,
boolean sanitize)
Add a tag to the top of this
TraceSegment with optional key sanitization. |
default void setTagTop(String key, Object value)
TraceSegment.key - key of the tagvalue - value of the tagvoid setTagTop(String key, Object value, boolean sanitize)
TraceSegment with optional key sanitization.key - key of the tagvalue - value of the tagsanitize - indicates is key need to be sanitizeddefault Object getTagTop(String key)
TraceSegment.key - key of the tagObject getTagTop(String key, boolean sanitize)
TraceSegment with optional key sanitization.key - key of the tagsanitize - indicates is key need to be sanitizeddefault void setTagCurrent(String key, Object value)
TraceSegment.key - key of the tagvalue - value of the tagvoid setTagCurrent(String key, Object value, boolean sanitize)
TraceSegment. with optional key sanitization.key - key of the tagvalue - value of the tagsanitize - indicates is key need to be sanitizeddefault Object getTagCurrent(String key)
TraceSegment.key - key of the tagObject getTagCurrent(String key, boolean sanitize)
TraceSegment. with optional key
sanitization.key - key of the tagsanitize - indicates is key need to be sanitizedvoid setDataTop(String key, Object value)
TraceSegment. The toString representation of the
value must be valid top level JSON, i.e. an Object or an Array.key - key of the datavalue - value of the dataObject getDataTop(String key)
TraceSegment.key - key of the datavoid effectivelyBlocked()
void setDataCurrent(String key, Object value)
TraceSegment. The toString representation
of the value must be valid top level JSON, i.e. an Object or an Array.key - key of the datavalue - value of the dataObject getDataCurrent(String key)
TraceSegment.key - key of the datavoid setMetaStructTop(String field, Object value)
TraceSegment.field - field namevalue - value of the data(String, Object)void setMetaStructCurrent(String field, Object value)
TraceSegment.field - field namevalue - value of the datadatadog.trace.common.writer.ddagent.TraceMapperV0_4.MetaStructWriter,
datadog.trace.core.CoreSpan#setMetaStruct(String, Object)