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
|
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 . |
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 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 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 datavoid effectivelyBlocked()