1.0.1 • Published 1 year ago

@nasa-gcn/architect-plugin-tracing v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

npm

Architect plugin for OpenTelemetry + AWS X-Ray

This is a plugin for Architect that automatically instruments your Node.js Lambdas with OpenTelemetry and sends tracing data and metrics to AWS X-Ray.

It adds the AWS Distro for OpenTelemetry Lambda layer to all of your Lambdas for which you have enabled tracing.

Usage

  1. Install this package using npm:

    npm i -D @nasa-gcn/architect-plugin-tracing
  2. Add the following to your project's app.arc configuration file:

    @plugins
    nasa-gcn/architect-plugin-tracing
  3. Enable tracing for all Lambdas by adding the folllowing lines to your app.arc file, or for an individual Lambda by adding it to the Lambda's config.arc file:

    @aws
    tracing true
  4. Optionally, you can inject additional OpenTelemetry configuration into a Lambda by adding a file called tracing.js to its source directory. Here is an example that adds instrumentation for the Remix web framework:

    ```js
    global.configureInstrumentations = () => {
      const { DnsInstrumentation } = require('@opentelemetry/instrumentation-dns')
      const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http')
      const { NetInstrumentation } = require('@opentelemetry/instrumentation-net')
      const {
        RemixInstrumentation,
      } = require('opentelemetry-instrumentation-remix')
    
      return [
        new DnsInstrumentation(),
        new HttpInstrumentation(),
        new NetInstrumentation(),
        new RemixInstrumentation(),
      ]
    }
    ```
1.0.1

1 year ago

1.0.0

2 years ago

0.0.1

2 years ago