nodejs-opentelemetry-example

A template of a Node.js Express application using Inngest with OpenTelemetry configured

1
0
1
2
JavaScript
public

Node.js OpenTelemetry Example

Minimal Express + Inngest demo instrumented with OpenTelemetry, exporting traces over OTLP HTTP (default http://localhost:4318/v1/traces).

Prerequisites

  • Node.js 18+ (ESM project)
  • Jaeger with OTLP HTTP enabled (example Docker: docker run -d --name jaeger -p 16686:16686 -p 4318:4318 -e COLLECTOR_OTLP_ENABLED=true jaegertracing/all-in-one:latest)

Install

npm install

Start the Express API

npm start

The API listens on http://localhost:3000.

Start the Inngest Dev Server

npx inngest-cli@latest dev -u http://localhost:3000/api/inngest --no-discovery

Trigger a trace

curl -X POST http://localhost:3000/users \
  -H "Content-Type: application/json" \
  -d '{"name":"John Doe","email":"john.doe@example.com"}'

Open the Jaeger UI to inspect the trace

Once Jaeger is running, you can access the Jaeger UI by navigating to http://localhost:16686 in your web browser.

In the Jaeger UI, you can view the spans generated by your Express application. By selecting the “nodejs-open-telemetry-example” service and click on “Find Traces”, a list of traces will display. This will help you understand the flow of requests and identify any performance bottlenecks.


License Apache

v0.3.3[beta]