Represents a Tracing instance that provides telemetry functionality.

Implements

  • TelemetryBase<void>

Constructors

Methods

Constructors

  • Creates a new instance of the Tracing class.

    Parameters

    • options: {
          attributes?: Attributes;
          autoInstrumentationsConfigMap?: InstrumentationConfigMap;
          debug?: boolean;
          hostname?: string;
          instrumentations?: InstrumentationOption[];
          isEnabled?: boolean;
          serviceName?: string;
          serviceVersion?: string;
          traceRatio?: number;
          url?: string;
      } = {}

      The options to configure the tracing functionality.

      • Optionalattributes?: Attributes

        Optional attributes to be added to the resource.

      • OptionalautoInstrumentationsConfigMap?: InstrumentationConfigMap

        Optional map of auto-instrumentation configurations.

      • Optionaldebug?: boolean

        Optional flag to enable debug mode.

      • Optionalhostname?: string

        The value of the hostname attribute to use, will override the hostname.

      • Optionalinstrumentations?: InstrumentationOption[]

        Optional array of instrumentations.

      • OptionalisEnabled?: boolean

        Specifies whether tracing is enabled.

      • OptionalserviceName?: string

        The name of the service to put as attribute. By default will be read from the package.json file.

      • OptionalserviceVersion?: string

        The version of the service to put as attribute. By default will be read from the package.json file.

      • OptionaltraceRatio?: number

        The ratio of traces to sample.

      • Optionalurl?: string

        The URL to an HTTP OTLP endpoint to send the traces to.

    Returns Tracing

Methods

  • Starts the tracing functionality.

    Returns void

  • Stops the tracing functionality.

    Returns Promise<void>

    A promise that resolves when the tracing is stopped.