Install - vFunction Distributed Agents on Containerized Linux Java App running via Dockerfile



Installation Steps

  1. Download the vFunction Distributed Agent from OpenTelemetry
  2. Create a folder for vFunction artifacts in the Artifact Repository accessible by the Docker Build
  3. Add the vFunction Distributed Agent to the Artifact Repository
  4. Create a vFunction specific branch to add the vFunction artificats to the Application’s Dockerfile
  5. Modify the existing Dockerfile to add the Distributed Agent and hook it into the running JVM
FROM <existing_docker_image>

COPY <existing_workflow>

RUN <existing_workflow>

### vFunction workflow

### Find-and-replace ARTIFACT_REPOSITORY with the actual location
### Find-and-replace all instances of BASE_DIR with the desired location on the Container, such as /tmp
COPY /ARTIFACT_REPOSITORY/vfunction/opentelemetry-javaagent.jar /BASE_DIR/opentelemetry-javaagent.jar

############ vFunction hook agent into JVM ############


### Replace all instances of BASE_DIR with the desired location on the Container, such as /tmp
### Replace $PROTOCOL://$VF_SERVER_ADDRESS with the URL for the VF Server
### Replace $VF_APP_ID in the UUID supplied in the VF Server UI's Installation Instructions
### Replace $MY_SERVICE with the name of the relevant Service
ENV JAVA_TOOL_OPTIONS="-javaagent:/BASE_DIR/opentelemetry-javaagent.jar -Dotel.exporter.otlp.protocol=http/protobuf -Dotel.exporter.otlp.endpoint=$PROTOCOL://$VF_SERVER_ADDRESS/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"

ENTRYPOINT [ EXISTING_WORKFLOW ]
  1. Build and deploy the Application
  2. Confirm that the Application comes up and functions as expected
  3. If any issues arise: