Anaconda OpenTelemetry for Typescript
    Preparing search index...

    Function getTrace

    • Create the parent or child tracing span object (ASpan) used to send trace events. The object end() must be called before the trace span can be sent to the collector.

      Parameters

      • name: string

        Name for the span object.

      • args: { attributes?: AttrMap; carrier?: CarrierMap; parentObject?: ASpan } | undefined = undefined

        Optional: Arguments for the function (see below)

        • { attributes?: AttrMap; carrier?: CarrierMap; parentObject?: ASpan }
          • Optionalattributes?: AttrMap

            Attributes payload to attach to the trace span.

          • Optionalcarrier?: CarrierMap

            This is a OTel carrier that can be recieved via message or HTTP headers from another process or source. If unsure don't include this argument. This is the parent when the parent is "remote" (i.e. client/server or across processes).

          • OptionalparentObject?: ASpan

            This is used as the parent for the new trace span like a carrier but in-process.

        • undefined

      Returns ASpan | undefined

      The ASpan object if successful, or undefined if not initialized.

      This method does not throw any known exceptions.

           const span = getTrace(name: "mySpanName", {attributes: { feature: "makeMoney" }})
      span.addEvent({ name: "MyEventName", attributes: { foo: "bar" }})
      span.end()