Monitoring Node.js applications from OpenTelemetry Demo on Instana

You can automatically instrument a Node.js application with the OpenTelemetry Demo and send metrics and traces to Instana through the Instana agent. You can view these metrics, trace, and logs data on the Instana UI. See the following example for instrumenting a Node.js-based application ('frontend') with the OpenTelemetry collector node.js agent:

The application provides a UI to the users and an API that is used by the UI or other clients. The application is based on Next.JS to provide a React web-based UI and API routes. The application is composed of two layers:

  • Client side application, which renders the components for the OTEL webstore.
  • API layer, which connects the client to the backend services by exposing REST endpoints. To get started with the OpenTelemetry integration, see the following sample steps:

Prerequisites

Before you begin, make sure that the following technologies are installed:

  • Docker
  • Docker Compose v2.0.0 or later

Deploying the application locally

To deploy the application, run the following commands at the root directory of the project:

git clone https://github.com/open-telemetry/opentelemetry-demo.git
cd opentelemetry-demo/
docker compose run --service-ports -e NODE_ENV=development --volume $(pwd)/src/frontend:/app --volume $(pwd)/pb:/app/pb --user node --entrypoint sh frontend

When you run Docker Compose at the root level, it installs all the required backend services.

Then, within the container, run the following command:

npm run dev

After you run the command, access the application at http://localhost:8080/.

Checking the metrics in Instana UI

You can see the OpenTelemetry data such as metrics, trace, and log in the Instana UI. For more information, see Viewing the OpenTelemetry metrics data in the Instana UI generated by OpenTelemetry Demo application.

Before you start to view the data, you must configure your Instana backend and agent properly to collect data from the service.