Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Spanner<Options>

Package version

Type of the auto-spanner returned by makeSpanner

internal

Type parameters

  • Options

Hierarchy

  • Spanner

Index

Methods

Methods

span

  • span<Args, Result>(name: string, handler: (updatedOptions: Options, ...rest: Args) => Result): (...args: Args) => Result
  • Invokes a handler in the context of a span. When the handler is called, an argument will be inserted at the beginning of the arguments list containing the options that may have been updated by the tracer.

    Type parameters

    • Args: unknown[]

    • Result

    Parameters

    • name: string

      the name of this span, which will appear in the trace.

    • handler: (updatedOptions: Options, ...rest: Args) => Result

      the handler to run. Its first parameter will have the type of options that were passed to makeSpanner

        • (updatedOptions: Options, ...rest: Args): Result
        • Parameters

          • updatedOptions: Options
          • Rest ...rest: Args

          Returns Result

    Returns (...args: Args) => Result

    a function that will wrap a call to the handler in tracing code, forwarding its parameters

      • (...args: Args): Result
      • Parameters

        • Rest ...args: Args

        Returns Result

Generated using TypeDoc