Package org.opensearch.telemetry.tracing
Interface ScopedSpan
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
NoopScopedSpan
An auto-closeable that represents scoped span.
It provides interface for all the span operations.
- Opensearch.experimental:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String key, boolean value) Adds boolean attribute to theSpan.voidaddAttribute(String key, double value) Adds double attribute to theSpan.voidaddAttribute(String key, long value) Adds long attribute to theSpan.voidaddAttribute(String key, String value) Adds string attribute to theSpan.voidAdds an event to theSpan.voidclose()closes the scopevoidRecords error in the span
-
Field Details
-
NO_OP
No-op Scope implementation
-
-
Method Details
-
addAttribute
Adds string attribute to theSpan.- Parameters:
key- attribute keyvalue- attribute value
-
addAttribute
Adds long attribute to theSpan.- Parameters:
key- attribute keyvalue- attribute value
-
addAttribute
Adds double attribute to theSpan.- Parameters:
key- attribute keyvalue- attribute value
-
addAttribute
Adds boolean attribute to theSpan.- Parameters:
key- attribute keyvalue- attribute value
-
addEvent
Adds an event to theSpan.- Parameters:
event- event name
-
setError
Records error in the span- Parameters:
exception- exception to be recorded
-
close
void close()closes the scope- Specified by:
closein interfaceAutoCloseable
-