Digma Quick Start
Guide for NODEJS

Get Digma up and running

  1. Install the Digma IDE plugin 

Start the Digma backend locally 

  1. Run the following from terminal/command line:

Linux & MacOS:

curl -L https://get.digma.ai/ --output docker-compose.yml

Windows (PowerShell):

iwr https://get.digma.ai/ -outfile docker-compose.yml
  1. Then run:
docker compose up -d

to start the Digma backend. (You’ll need Docker and Docker Compose installed)

Prefer to use a Helm file? Check out these instructions instead:

Set Up Tracing

Prerequisites

  1. Set up Digma’s trace instrumentation:

Install Digma’s OTEL module:

npm install --save @digma/otel-js-instrumentation

Create and merge the OTEL resource with your resource, for example:

const { digmaAttributes } = require('@digma/otel-js-instrumentation');


const sdk = new opentelemetry.NodeSDK({
  resource: new Resource({
    [SemanticResourceAttributes.SERVICE_NAME]: "my-service",
    ...digmaAttributes({
      rootPath: __dirname,
    }),
  }),
  spanProcessor: new BatchSpanProcessor(exporter),
  instrumentations: [getNodeAutoInstrumentations()],
});
  1. Connect Digma to your OTEL Collector (Optional)

If you are already using an OTEL Collector, you can modify your collector configuration file to add Digma’s receiver as a target. For example:

otlp/digma:
    endpoint: "localhost:5050"
    tls:
      insecure: true
service:
  pipelines:
    traces:
      exporters: [otlp/digma, ...]

Finally, connect your code to Digma!

Add one or two lines of code to instrument Digma.

Jump to: Express, Fastify (Coming soon)

Get More Out of Digma

To find out about adding environments, commit information, and other configuration options, check out the Digma instrumentation page.

New to observability? OpenTelemetry has extensive documentation explaining how to get started. [ Get started with OpenTelemetry ]

NODEJS Quick Start Guide - separator

Adding Digma to your OTEL Instrumentation

NODEJS / EXPRESS

  1. Install the Digma Express OTEL instrumentation module:
npm install --save @digma/instrumentation-express
  1. Add the Digma Route Handler to the app, which will add some additional attributes to your OTEL spans:
const { digmaRouteHandler } = require('@digma/instrumentation-express');

app = express();
app.use(digmaRouteHandler);
app.use('/users', users); // some router example

You’re good to go! Check out our sample NodeJs project for reference.

NODEJS / Fastify

TBD