Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 655 Bytes

File metadata and controls

37 lines (30 loc) · 655 Bytes

js

This application demonstrates a Node.js API that can be auto instrumented with OTel Node.js.

API

POST /users 
Adds a new user. Fields: name, email
GET /users 
Gets all users
GET /users/:name
Gets user by name
PUT /users/:id
Updates user by ID (idempotent)

Setup

Run the following to install dependencies:

npm install

Run the following to run the app with OTel auto instrumentation:

export OTEL_TRACES_EXPORTER=console
export NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"
node app.js