Package datadog.trace.api.internal
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.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidMark the request as effectively blocked, by setting the tag appsec.blockedgetDataCurrent(String key) Gets the value of the tag from the current span in thisTraceSegment.getDataTop(String key) Gets the value of the tag from the top of thisTraceSegment.default ObjectgetTagCurrent(String key) Get the tag value from the current span in thisTraceSegment.getTagCurrent(String key, boolean sanitize) Get the tag value from the current span in thisTraceSegment.default ObjectGet the tag value from the top of thisTraceSegment.Get the tag value from the top of thisTraceSegmentwith optional key sanitization.voidsetDataCurrent(String key, Object value) Add data to the current span in thisTraceSegment.voidsetDataTop(String key, Object value) Add data to the top of thisTraceSegment.voidsetMetaStructCurrent(String field, Object value) Add a field to the current span meta_struct in thisTraceSegment.voidsetMetaStructTop(String field, Object value) Add a field to the meta_struct of the top of thisTraceSegment.default voidsetTagCurrent(String key, Object value) Add a tag to the current span in thisTraceSegment.voidsetTagCurrent(String key, Object value, boolean sanitize) Add a tag to the current span in thisTraceSegment.default voidAdd a tag to the top of thisTraceSegment.voidAdd a tag to the top of thisTraceSegmentwith optional key sanitization.
-
Method Details
-
setTagTop
Add a tag to the top of thisTraceSegment.- Parameters:
key- key of the tagvalue- value of the tag
-
setTagTop
Add a tag to the top of thisTraceSegmentwith optional key sanitization.- Parameters:
key- key of the tagvalue- value of the tagsanitize- indicates is key need to be sanitized
-
getTagTop
Get the tag value from the top of thisTraceSegment.- Parameters:
key- key of the tag
-
getTagTop
Get the tag value from the top of thisTraceSegmentwith optional key sanitization.- Parameters:
key- key of the tagsanitize- indicates is key need to be sanitized
-
setTagCurrent
Add a tag to the current span in thisTraceSegment.- Parameters:
key- key of the tagvalue- value of the tag
-
setTagCurrent
Add a tag to the current span in thisTraceSegment. with optional key sanitization.- Parameters:
key- key of the tagvalue- value of the tagsanitize- indicates is key need to be sanitized
-
getTagCurrent
Get the tag value from the current span in thisTraceSegment.- Parameters:
key- key of the tag
-
getTagCurrent
Get the tag value from the current span in thisTraceSegment. with optional key sanitization.- Parameters:
key- key of the tagsanitize- indicates is key need to be sanitized
-
setDataTop
Add data to the top of thisTraceSegment. ThetoStringrepresentation of thevaluemust be valid top level JSON, i.e. anObjector anArray.- Parameters:
key- key of the datavalue- value of the data
-
getDataTop
Gets the value of the tag from the top of thisTraceSegment.- 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
Add data to the current span in thisTraceSegment. ThetoStringrepresentation of thevaluemust be valid top level JSON, i.e. anObjector anArray.- Parameters:
key- key of the datavalue- value of the data
-
getDataCurrent
Gets the value of the tag from the current span in thisTraceSegment.- Parameters:
key- key of the data- Returns:
- value of the data
-
setMetaStructTop
Add a field to the meta_struct of the top of thisTraceSegment.- Parameters:
field- field namevalue- value of the data- See Also:
-
setMetaStructCurrent
Add a field to the current span meta_struct in thisTraceSegment.- Parameters:
field- field namevalue- value of the data- See Also:
-