Class TracingUtils
java.lang.Object
com.couchbase.client.core.io.netty.TracingUtils
Contains various utils to set attributes for tracing spans.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidsetCommonDispatchSpanAttributes(TracingDecorator tip, RequestSpan span, String localId, String localHost, int localPort, String remoteCanonicalHost, int remoteCanonicalPort, String remoteActualHost, int remoteActualPort, String operationId) Sets common dispatch span attributes as per spec.static voidsetCommonKVSpanAttributes(RequestSpan span, KeyValueRequest<Response> request) Sets attributes that are usefully duplicated across multiple spans.static voidsetServerDurationAttribute(TracingDecorator tip, RequestSpan span, long serverDuration) Sets the server duration attribute, if larger than 0 (will ignore it otherwise).
-
Method Details
-
setCommonDispatchSpanAttributes
public static void setCommonDispatchSpanAttributes(TracingDecorator tip, RequestSpan span, @Nullable String localId, @Nullable String localHost, int localPort, @Nullable String remoteCanonicalHost, int remoteCanonicalPort, @Nullable String remoteActualHost, int remoteActualPort, @Nullable String operationId) Sets common dispatch span attributes as per spec.- Parameters:
span- the affected span.localId- the local socket ID.localHost- the local hostname or ip.localPort- the local port.remoteCanonicalHost- the canonical remote hostname or ip.remoteCanonicalPort- the canonical remote port.remoteActualHost- the actual remote hostname or ip.remoteActualPort- the actual remote port.operationId- the unique operation ID - can be null (then ignored).
-
setCommonKVSpanAttributes
Sets attributes that are usefully duplicated across multiple spans. -
setServerDurationAttribute
public static void setServerDurationAttribute(TracingDecorator tip, RequestSpan span, long serverDuration) Sets the server duration attribute, if larger than 0 (will ignore it otherwise).- Parameters:
span- the span where it should be set.serverDuration- the actual duration.
-