Class OpenTelemetryRequestSpan
java.lang.Object
com.couchbase.client.tracing.opentelemetry.OpenTelemetryRequestSpan
- All Implemented Interfaces:
RequestSpan
public class OpenTelemetryRequestSpan extends Object implements RequestSpan
Wraps an OpenTelemetry span, ready to be passed in into options for each operation into the SDK as a parent.
-
Method Summary
Modifier and Type Method Description void
attribute(String key, boolean value)
void
attribute(String key, long value)
void
attribute(String key, String value)
void
end()
void
event(String name, Instant timestamp)
void
requestContext(RequestContext requestContext)
io.opentelemetry.api.trace.Span
span()
Returns the wrapped OpenTelemetry span.static OpenTelemetryRequestSpan
wrap(io.opentelemetry.api.trace.Span span)
Wraps an OpenTelemetry span so that it can be passed in to the SDK-operation options as a parent.
-
Method Details
-
wrap
Wraps an OpenTelemetry span so that it can be passed in to the SDK-operation options as a parent.- Parameters:
span
- the span that should act as the parent.- Returns:
- the created wrapped span.
-
span
public io.opentelemetry.api.trace.Span span()Returns the wrapped OpenTelemetry span. -
attribute
- Specified by:
attribute
in interfaceRequestSpan
-
attribute
- Specified by:
attribute
in interfaceRequestSpan
-
attribute
- Specified by:
attribute
in interfaceRequestSpan
-
event
- Specified by:
event
in interfaceRequestSpan
-
end
public void end()- Specified by:
end
in interfaceRequestSpan
-
requestContext
- Specified by:
requestContext
in interfaceRequestSpan
-