opentelemetry-js/examples/basic-tracer-node
Trent Mick 4f9b31b78a
docs: update from deprecated SEMRESATTRS_SERVICE_NAME to ATTR_SERVICE_NAME (#5604)
2025-04-10 07:35:26 +00:00
..
docker/ot feat(otlp-exporter-http): change otlp-http port to canonical 4318 (#2557) 2022-01-20 08:57:46 -05:00
images chore: Docs wording and example for basic-tracer (#361) 2019-09-28 02:26:19 +02:00
README.md chore(lint): refactor Markdown linting to use markdownlint-cli2 (#4713) 2024-05-21 14:44:23 +02:00
index.js docs: update from deprecated SEMRESATTRS_SERVICE_NAME to ATTR_SERVICE_NAME (#5604) 2025-04-10 07:35:26 +00:00
package.json chore!: bump min-supported node to ^18.19.0 || >=20.6.0 (#5397) 2025-01-31 09:18:27 +00:00

README.md

Overview

This example shows how to use @opentelemetry/sdk-trace-base to instrument a simple Node.js application - e.g. a batch job.

Our example will export spans data simultaneously on Console and Jaeger, however you can run your code anywhere and can use any exporter that OpenTelemetry supports.

Installation

# from this directory
npm install

(Optional) Setup Jaeger Tracing: needs to be running on localhost port 16686.

Run the Application

# from this directory
npm start

Jaeger UI

Open the Jaeger UI in your browser http://localhost:16686

Jaeger UI showing list of traces

Select basic-service under Service Name and click on Find Traces.

Click on the trace to view its details.

Jaeger UI showing a trace

LICENSE

Apache License 2.0