Interface SpanStatusBuilder


public interface SpanStatusBuilder
A builder that exposes methods for setting the status of a span.
  • Method Summary

    Modifier and Type
    Method
    Description
    setStatus(io.opentelemetry.api.trace.StatusCode statusCode)
    Sets the status to the Span.
    setStatus(io.opentelemetry.api.trace.StatusCode statusCode, String description)
    Sets the status to the Span.
  • Method Details

    • setStatus

      @CanIgnoreReturnValue default SpanStatusBuilder setStatus(io.opentelemetry.api.trace.StatusCode statusCode)
      Sets the status to the Span.

      If used, this will override the default Span status. Default status code is StatusCode.UNSET.

      Only the value of the last call will be recorded, and implementations are free to ignore previous calls.

      Parameters:
      statusCode - the StatusCode to set.
      Returns:
      this.
      See Also:
      • Span.setStatus(StatusCode)
    • setStatus

      @CanIgnoreReturnValue SpanStatusBuilder setStatus(io.opentelemetry.api.trace.StatusCode statusCode, String description)
      Sets the status to the Span.

      If used, this will override the default Span status. Default status code is StatusCode.UNSET.

      Only the value of the last call will be recorded, and implementations are free to ignore previous calls.

      Parameters:
      statusCode - the StatusCode to set.
      description - the description of the Status.
      Returns:
      this.
      See Also:
      • Span.setStatus(StatusCode, String)