Class OpenTelemetryRequestSpan

java.lang.Object
com.couchbase.client.tracing.opentelemetry.OpenTelemetryRequestSpan
All Implemented Interfaces:
com.couchbase.client.core.cnc.RequestSpan

public class OpenTelemetryRequestSpan extends Object implements com.couchbase.client.core.cnc.RequestSpan
Wraps an OpenTelemetry span, ready to be passed in into options for each operation into the SDK as a parent.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.couchbase.client.core.cnc.RequestSpan

    com.couchbase.client.core.cnc.RequestSpan.StatusCode
  • 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
     
    void
    requestContext(com.couchbase.client.core.msg.RequestContext requestContext)
     
    io.opentelemetry.api.trace.Span
    Returns the wrapped OpenTelemetry span.
    void
    status(com.couchbase.client.core.cnc.RequestSpan.StatusCode status)
     
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.couchbase.client.core.cnc.RequestSpan

    lowCardinalityAttribute, lowCardinalityAttribute, lowCardinalityAttribute
  • 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 com.couchbase.client.core.cnc.RequestSpan
    • attribute

      public void attribute(String key, boolean value)
      Specified by:
      attribute in interface com.couchbase.client.core.cnc.RequestSpan
    • attribute

      public void attribute(String key, long value)
      Specified by:
      attribute in interface com.couchbase.client.core.cnc.RequestSpan
    • event

      public void event(String name, Instant timestamp)
      Specified by:
      event in interface com.couchbase.client.core.cnc.RequestSpan
    • status

      public void status(com.couchbase.client.core.cnc.RequestSpan.StatusCode status)
      Specified by:
      status in interface com.couchbase.client.core.cnc.RequestSpan
    • recordException

      public void recordException(Throwable err)
      Specified by:
      recordException in interface com.couchbase.client.core.cnc.RequestSpan
    • end

      public void end()
      Specified by:
      end in interface com.couchbase.client.core.cnc.RequestSpan
    • requestContext

      public void requestContext(com.couchbase.client.core.msg.RequestContext requestContext)
      Specified by:
      requestContext in interface com.couchbase.client.core.cnc.RequestSpan