OpenTelemetry Agent - Java Jetty App Server Installation



Installation Steps with no OpenTelemetry Collector

  1. Gather the vFunction Server UI’s UUID for the vFunction Distributed Application
  1. Log into the vFunction Server UI
  2. In the top-left corner, click the dropdown
  3. Click Add Application from the dropdown menu
  4. Type a name for the Application in the Application Name text field
  5. Toggle the slider to Distributed
  6. Click the blue Create button
  7. In the dialog box that launches, toggle the tabs to Java
  8. In the text box with OTEL Environment Variables, find the OTEL_EXPORT_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADER. These will be used at a later stage of the installation
  1. Download the Open Telemetry Java Agent
  2. Move the Opentelemetry-javaagent.jar to a place on the filesystem where the Java application runs
  3. Add the Java Agent JVM parameters to the Application
  1. On the Jetty Application Server, open JETTY_HOME/bin/jetty.sh
  2. Find the section of the file for setting the Java VM options
/Java VM options
  1. Add the lines below to this file
VF_BASE_PATH="/opt/jetty/agents"
VF_SERVER_URL="https://vfunction.mycompany.com"
VF_APP_ID="UUID-FROM-VF-SERVER"
MY_SERVICE="NAME-OF-SERVICE"

VFUN_OPTS="-javaagent:$VF_BASE_PATH/opentelemetry-javaagent.jar -Dotel.exporter.otlp.protocol=http/protobuf -Dotel.exporter.otlp.endpoint=$VF_SERVER_URL/api/unauth/otlp -Dotel.traces.exporter=otlp -Dotel.exporter.otlp.traces.headers=X-VF-APP=$VF_APP_ID -Dotel.metrics.exporter=none -Dotel.logs.exporter=none -Dotel.service.name=$MY_SERVICE"

JAVA_OPTIONS="$JAVA_OPTIONS $VFUN_OPTS"
  1. Restart the application

Installation Steps with an OpenTelemetry Collector

  1. Download the Open Telemetry Java Agent
  2. Move the Opentelemetry-javaagent.jar to a place on the filesystem where the Java application runs
  3. Add the Java Agent JVM parameters to the Application
  1. On the Jetty Application Server, open JETTY_HOME/bin/jetty.sh
  2. Find the section of the file for setting the Java VM options
/Java VM options
  1. Add the lines below to this file
### Set values below
VF_BASE_PATH="/opt/jboss/agents"
COLLECTOR_URL="https://collector:4318"
MY_SERVICE="NAME-OF-SERVICE"

VFUN_OPTS="-javaagent:$VF_BASE_PATH/opentelemetry-javaagent.jar -Dotel.exporter.otlp.endpoint=$COLLECTOR_URL -Dotel.service.name=$MY_SERVICE"

export JAVA_OPTS="$VFUN_OPTS $JAVA_OPTS"
  1. Restart the Application