use of com.couchbase.client.core.error.TracerException in project couchbase-jvm-clients by couchbase.
the class OpenTracingRequestTracer method requestSpan.
@Override
public RequestSpan requestSpan(final String operationName, final RequestSpan parent) {
try {
Tracer.SpanBuilder builder = tracer.buildSpan(operationName);
if (parent != null) {
builder.asChildOf(castSpan(parent));
}
Span span = builder.start();
tracer.activateSpan(span).close();
return OpenTracingRequestSpan.wrap(tracer, span);
} catch (Exception ex) {
throw new TracerException("Failed to create OpenTracingRequestSpan", ex);
}
}
use of com.couchbase.client.core.error.TracerException in project couchbase-jvm-clients by couchbase.
the class OpenTelemetryRequestTracer method requestSpan.
@Override
public RequestSpan requestSpan(String operationName, RequestSpan parent) {
try {
SpanBuilder spanBuilder = tracer.spanBuilder(operationName);
Context parentContext = Context.current();
if (parent != null) {
parentContext = parentContext.with(castSpan(parent));
}
Span span = spanBuilder.setParent(parentContext).startSpan();
return OpenTelemetryRequestSpan.wrap(span);
} catch (Exception ex) {
throw new TracerException("Failed to create OpenTelemetryRequestSpan", ex);
}
}
Aggregations