opentelemetry-js/examples/otlp-exporter-node
OpenTelemetry Bot 9dbd1e446b
chore: prepare next release (#5696)
2025-05-19 09:14:41 +00:00
..
docker feat(sdk-metrics-base): implement min/max recording for Histograms (#3032) 2022-06-24 08:52:42 -04:00
images chore!: rename collector exporters (#2476) 2021-09-15 20:41:08 +02:00
README.md chore(lint): refactor Markdown linting to use markdownlint-cli2 (#4713) 2024-05-21 14:44:23 +02:00
metrics.js docs: update from deprecated SEMRESATTRS_SERVICE_NAME to ATTR_SERVICE_NAME (#5604) 2025-04-10 07:35:26 +00:00
package.json chore: prepare next release (#5696) 2025-05-19 09:14:41 +00:00
tracing.js docs: update from deprecated SEMRESATTRS_SERVICE_NAME to ATTR_SERVICE_NAME (#5604) 2025-04-10 07:35:26 +00:00

README.md

Overview

This example shows how to use @opentelemetry/exporter-trace-otlp-http and @opentelemetry/exporter-metrics-otlp-http to instrument a simple Node.js application.

Installation

# from this directory
npm install

Run the Application

  1. Run docker

    # from this directory
    npm run docker:start
    
  2. Run tracing app

    # from this directory
    npm run start:tracing
    
  3. Run metrics app

    # from this directory
    npm run start:metrics
    
  4. Open page at http://localhost:9411/zipkin/ - you should be able to see the spans in zipkin Screenshot of the running example

Prometheus UI

The prometheus client will be available at http://localhost:9090.

Note: It may take some time for the application metrics to appear on the Prometheus dashboard.

Prometheus UI showing a charted Counter

Prometheus UI showing a charted UpDownCounter

LICENSE

Apache License 2.0