Class SpanContext

java.lang.Object
org.opensearch.telemetry.tracing.SpanContext

@ExperimentalApi public final class SpanContext extends Object
Wrapped Span will be exposed to the code outside of tracing package for sharing the Span without having access to its properties.
Opensearch.experimental:
  • Constructor Details

    • SpanContext

      public SpanContext(Span span)
      Constructor.
      Parameters:
      span - span to be wrapped.
  • Method Details

    • setError

      public void setError(Exception cause)
      Sets the error for the current span behind this context
      Parameters:
      cause - error
    • endSpan

      public void endSpan()
      Ends current span