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 Details

    • wrap

      public 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.
      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

      public void attribute​(String key, String value)
      Specified by:
      attribute in interface RequestSpan
    • attribute

      public void attribute​(String key, boolean value)
      Specified by:
      attribute in interface RequestSpan
    • attribute

      public void attribute​(String key, long value)
      Specified by:
      attribute in interface RequestSpan
    • event

      public void event​(String name, Instant timestamp)
      Specified by:
      event in interface RequestSpan
    • end

      public void end()
      Specified by:
      end in interface RequestSpan
    • requestContext

      public void requestContext​(RequestContext requestContext)
      Specified by:
      requestContext in interface RequestSpan