public interface TelemetrySpan extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close()
AutoCloseable.close() that can be used to end this span and, making it possible to create new span within the try-with-resources blocks. |
default void |
end()
Marks the end of the execution of this span.
|
TelemetryScope |
makeCurrent()
Takes this telemetry span and makes it current in the global telemetry context.
|
default void |
setAttribute(TelemetryAttribute key,
long value)
Adds the specified long attribute to this telemetry span.
|
default void |
setAttribute(TelemetryAttribute key,
String value)
Adds the specified String attribute to this telemetry span.
|
default <T> void |
setAttribute(TelemetryAttribute key,
Supplier<T> valueSupplier)
Adds the attribute given by the specified supplier to this telemetry span.
|
default void |
setError(Throwable cause)
Sets the status code of this telemetry span as ERROR and records the stack trace of the specified exception.
|
TelemetryScope makeCurrent()
AutoCloseable telemetry scope that represents the current telemetry context.default void setAttribute(TelemetryAttribute key, String value)
key - the key for this attributevalue - the value for this attributedefault void setAttribute(TelemetryAttribute key, long value)
key - the key for this attributevalue - the value for this attributedefault <T> void setAttribute(TelemetryAttribute key, Supplier<T> valueSupplier)
T - the type of the attribute valuekey - the key for this attributevalueSupplier - the supplier for the value for this attributedefault void setError(Throwable cause)
cause - the cause for setting this span status code to ERRORdefault void end()
default void close()
AutoCloseable.close() that can be used to end this span and, making it possible to create new span within the try-with-resources blocks.close in interface AutoCloseable