dd-trace
    Preparing search index...

    Interface Span

    Span represents a logical unit of work as part of a broader Trace. Examples of span might include remote procedure calls or a in-process function calls to sub-components. A Trace has a single, top-level "root" Span that in turn may have zero or more child Spans, which in turn may have children.

    interface Span {
        addLink(context: SpanContext, attributes?: Object): void;
        addLink(link: { attributes?: Object; context: SpanContext }): void;
        addLinks(links: { attributes?: Object; context: SpanContext }[]): void;
        context(): SpanContext;
    }

    Hierarchy

    • Span
      • Span
    Index

    Methods

    • Causally links another span to the current span

      Parameters

      • context: SpanContext

        The context of the span to link to.

      • Optionalattributes: Object

        An optional key value pair of arbitrary values.

      Returns void

      In favor of addLink(link: { context: SpanContext, attributes?: Object }). This will be removed in the next major version.

    • Adds a single link to the span.

      Links added after the creation will not affect the sampling decision. It is preferred span links be added at span creation.

      Parameters

      • link: { attributes?: Object; context: SpanContext }

        the link to add.

      Returns void

    • Adds multiple links to the span.

      Links added after the creation will not affect the sampling decision. It is preferred span links be added at span creation.

      Parameters

      • links: { attributes?: Object; context: SpanContext }[]

        the links to add.

      Returns void