Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Getting Started Guide - Java

This is the solution (completely instrumented with OpenTelemetry) for the Java demo application used in the Getting Started Guide - Java doc.

Requires:

To run this demo app via the CLI:

  1. Switch to the java directory
  2. Set these two environment variables to send data to your New Relic account:
export OTEL_EXPORTER_OTLP_HEADERS=api-key=<your_license_key>
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT=4095
  1. Set this environment variable to name the demo app:
export OTEL_SERVICE_NAME=getting-started-java
export OTEL_RESOURCE_ATTRIBUTES=service.instance.id=123
  1. Run the following command
../gradlew bootRun
  1. To generate traffic, in a new terminal tab run the following command
./load-generator.sh
  1. To shut down the program, run the following in both shells or terminal tabs: ctrl + c.