couchbase
    Preparing search index...

    Interface RequestSpan

    Represents a single traced operation (span) in distributed tracing.

    A RequestSpan provides methods to add metadata (attributes), record events, set the final status, and mark the completion of an operation.

    interface RequestSpan {
        name: string;
        addEvent(key: string, startTime?: TimeInput): void;
        end(endTime?: TimeInput): void;
        setAttribute(key: string, value: AttributeValue): void;
        setStatus(status: SpanStatus): void;
    }

    Implemented by

    Index

    Properties

    name: string

    The name of the span, describing the operation being traced.

    Methods

    • Adds a timestamped event to the span.

      Parameters

      • key: string

        The event name.

      • OptionalstartTime: TimeInput

        The start time of the event.

      Returns void

    • Marks the span as complete and records the end time.

      Parameters

      • OptionalendTime: TimeInput

        Optional end time; defaults to current time if not provided.

      Returns void

    • Sets a single attribute (key-value pair) on the span.

      Parameters

      • key: string

        The attribute key.

      • value: AttributeValue

        The attribute value.

      Returns void

    • Sets the final status of the span.

      Parameters

      • status: SpanStatus

        The span status containing code and optional message.

      Returns void