Takaro - v0.6.0
    Preparing search index...

    A generic Span which holds trace data.

    interface Span {
        addEvent(
            name: string,
            attributesOrStartTime?: SpanTimeInput | SpanAttributes,
            startTime?: SpanTimeInput,
        ): this;
        addLink(link: SpanLink): this;
        addLinks(links: SpanLink[]): this;
        end(endTimestamp?: SpanTimeInput): void;
        isRecording(): boolean;
        recordException(exception: unknown, time?: number): void;
        setAttribute(key: string, value: SpanAttributeValue | undefined): this;
        setAttributes(attributes: SpanAttributes): this;
        setStatus(status: SpanStatus): this;
        spanContext(): SpanContextData;
        updateName(name: string): this;
    }
    Index

    Methods

    • Adds an event to the Span.

      Parameters

      • name: string
      • OptionalattributesOrStartTime: SpanTimeInput | SpanAttributes
      • OptionalstartTime: SpanTimeInput

      Returns this

    • Associates this span with a related span. Links can reference spans from the same or different trace and are typically used for batch operations, cross-trace scenarios, or scatter/gather patterns.

      Prefer setting links directly when starting a span (e.g. Sentry.startSpan()) as some context information is only available during span creation.

      Parameters

      • link: SpanLink

        The link containing the context of the span to link to and optional attributes

      Returns this

    • Associates this span with multiple related spans. See addLink for more details.

      Prefer setting links directly when starting a span (e.g. Sentry.startSpan()) as some context information is only available during span creation.

      Parameters

      • links: SpanLink[]

        Array of links to associate with this span

      Returns this

    • End the current span.

      Parameters

      • OptionalendTimestamp: SpanTimeInput

      Returns void

    • If this is span is actually recording data. This will return false if tracing is disabled, this span was not sampled or if the span is already finished.

      Returns boolean

    • NOT USED IN SENTRY, only added for compliance with OTEL Span interface

      Parameters

      • exception: unknown
      • Optionaltime: number

      Returns void

    • Set a single attribute on the span. Set it to undefined to remove the attribute.

      Parameters

      • key: string
      • value: SpanAttributeValue | undefined

      Returns this

    • Set multiple attributes on the span. Any attribute set to undefined will be removed.

      Parameters

      • attributes: SpanAttributes

      Returns this

    • Sets the status attribute on the current span.

      Parameters

      • status: SpanStatus

      Returns this

    • Get context data for this span. This includes the spanId & the traceId.

      Returns SpanContextData

    • Update the name of the span.

      Important: You most likely want to use Sentry.updateSpanName(span, name) instead!

      This method will update the current span name but cannot guarantee that the new name will be the final name of the span. Instrumentation might still overwrite the name with an automatically computed name, for example in http.server or db spans.

      You can ensure that your name is kept and not overwritten by calling Sentry.updateSpanName(span, name)

      Parameters

      • name: string

        the new name of the span

      Returns this