Skip to content

Latest commit

 

History

History
 
 

simple-nodejs-app

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

OpenTelemetry-JS SDK New Relic Config - OTLP/gRPC Exporter

Introduction

This is an example of auto-instrumenting a simple express application with OpenTelemetry-JS and exporting traces to New Relic using OTLP/gRPC Trace Exporter.

Prerequisites

  1. Sign up for a free New Relic account.

  2. Copy your New Relic account ingest license key.

Run

  1. Run npm install.

  2. Set the following environment variables:

    export OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317
    
    export OTEL_EXPORTER_OTLP_HEADERS=api-key=<your_license_key_here>
    • Replace <your_license_key_here> with your New Relic account ingest license key.
  3. Run the application:

    npm start
    • This is a script to load the tracing code before the application code.

The application exposes a simple endpoint at http://localhost:8080/ping.

Invoke it via: curl http://localhost:8080/ping to generate trace data.

View your data in the New Relic UI

The application produces trace data reporting to a service named OpenTelemetry-Node.JS-Example.