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.
- Node 16.x
- Docker
- New Relic Account - Sign up for a free account
- Clone the repository:
git clone https://github.com:zmrfzn/opentelemetry-auto-instrumentation-MLT.git
- Install dependencies
npm install
- Start the application with the otel-wrapper module
node --require ./otel-wrapper server
app runs on PORT 3000
- 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
- Generate Load & Test
Generate some load on the application on the available endpoints.
- /
- /path
- /weather?location=
- / - accepts a JSON object in the body