Skip to content

A demo nodejs app demonstrating how to configure Otel to monitor application and infrastructure

Notifications You must be signed in to change notification settings

kloudmate/samplenodejs

 
 

Repository files navigation

Sample Node.js Application with OpenTelemetry Configuration

This repository contains a simple Node.js application that demonstrates how to configure OpenTelemetry to monitor both application and infrastructure. The application includes Docker Compose configurations for easy deployment.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js
  • Docker

Installation Steps

  1. Clone the repository:

    git clone https://github.com/kloudmate/samplenodejs.git
  2. Change into the repository directory:

    cd samplenodejs
  3. Create a .env file in the root directory. You can refer to the provided env.example for the required environment variables.

  4. Run the application using Docker Compose:

    docker-compose up -d

This will start the main application along with a PostgreSQL database, Redis, and the OpenTelemetry collector.

  1. Visit http://localhost:3006

OpenTelemetry Configuration

The application is instrumented using OpenTelemetry to collect traces, logs, and metrics. The configuration can be found in the server/src/instrumentation.js file and client/src/tracing.js.

Feel free to explore the code and modify the OpenTelemetry configuration as needed for your specific requirements.

About

A demo nodejs app demonstrating how to configure Otel to monitor application and infrastructure

Resources

Stars

Watchers

Forks

Languages

  • TypeScript 83.2%
  • JavaScript 13.8%
  • CSS 1.8%
  • Other 1.2%