How to use the dd-trace.wrap function in dd-trace

To help you get started, we’ve selected a few dd-trace examples, based on popular ways it is used in public projects.

github DataDog / datadog-lambda-layer-js / src / trace / listener.ts View on Github external
const options: SpanOptions & TraceOptions = {};
    if (this.context) {
      options.tags = {
        cold_start: this.coldstart,
        event_source: this.eventSource,
        function_arn: this.context.invokedFunctionArn,
        request_id: this.context.awsRequestId,
        resource_names: this.context.functionName,
      };
    }

    if (spanContext !== null) {
      options.childOf = spanContext;
    }

    return Tracer.wrap(this.handlerName, options, func);
  }
}

dd-trace

Datadog APM tracing client for JavaScript

BSD-3-Clause
Latest version published 11 days ago

Package Health Score

83 / 100
Full package analysis

Similar packages