Class SpanCreationContext

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

@ExperimentalApi public final class SpanCreationContext extends Object
Context for span details.
Opensearch.experimental:
  • Method Details

    • server

      public static SpanCreationContext server()
      Sets the span type to server.
      Returns:
      spanCreationContext
    • client

      public static SpanCreationContext client()
      Sets the span type to client.
      Returns:
      spanCreationContext
    • internal

      public static SpanCreationContext internal()
      Sets the span type to internal.
      Returns:
      spanCreationContext
    • name

      public SpanCreationContext name(String spanName)
      Sets the span name.
      Parameters:
      spanName - span name.
      Returns:
      spanCreationContext
    • attributes

      public SpanCreationContext attributes(Attributes attributes)
      Sets the span attributes.
      Parameters:
      attributes - attributes.
      Returns:
      spanCreationContext
    • parent

      public SpanCreationContext parent(SpanContext parent)
      Sets the parent for span
      Parameters:
      parent - parent span context
      Returns:
      spanCreationContext
    • getSpanName

      public String getSpanName()
      Returns the span name.
      Returns:
      span name
    • getAttributes

      public Attributes getAttributes()
      Returns the span attributes.
      Returns:
      attributes.
    • getSpanKind

      public SpanKind getSpanKind()
      Returns the span kind.
      Returns:
      spankind.
    • getParent

      public SpanContext getParent()
      Returns the parent span
      Returns:
      parent.