/opentelemetry-auto-instrumentation-MLT

Node application with Open Telemetry auto instrumentation capturing Metrics, Logs & Traces with Open Telemetry Collector

Primary LanguageJavaScript


Open Telemetry MLT (Metrics, Logs , Traces) with Nodejs

This is a Node.js application built with the Koa framework and instrumented with OpenTelemetry automatic instrumentation of Metrics, Logs & Traces, it also provides a Open Telemetry collector configuration config.yaml to export your telemetry to the collector.

Prerequisites

  • Node 16.x
  • Docker
  • New Relic Account - Sign up for a free account

Getting Started

  1. Clone the repository:
git clone https://github.com:zmrfzn/opentelemetry-auto-instrumentation-MLT.git
  1. Install dependencies
npm install
  1. Start the application with the otel-wrapper module
node --require ./otel-wrapper server

app runs on PORT 3000

  1. Start the Open Telemetry collector with configuration file in the root directory.

Add your New Relic INGEST license key by replacing the placeholder for the ENV VAR

docker run -d \
-v "${PWD}/config.yaml":/config.yaml \
-p 4318:4318 \
-p 4317:4317 \
-e NR_LICENSE_KEY=<YOUR NEW RELIC INGEST LICENSE>
otel/opentelemetry-collector-contrib \
--config config.yaml
  1. Generate Load & Test

Generate some load on the application on the available endpoints.

GET

  • /
  • /path
  • /weather?location=

POST

  • / - accepts a JSON object in the body