How to use an existing OpenTelemetry Agent for Database Tracking with a Java Agent



Overview of the Issue

This issue occurs in the following way:

  1. A vFunction organization installs the Runtime Agent to profile their Java Application
  2. Unexpectedly, the organization does not see Database Tables in the Resources Report after smoking testing their Java Application with the Runtime Agent hooked using the default JDBC tracking mechanism
  3. The organization modifies the vFunction Database Tracking workflow, runs the upgrade script and restart the JVM
  1. Open the installation.yaml associated with the instance:
  • Linux Sudo sample location: /etc/sysconfig/vfunction/installation/instances/default-java/installation.yaml
  • Linux Sudoless sample location: /tmp/vfunction/etc/sysconfig/vfunction/installation/instances/default-java/installation.yaml
  • Windows sample location: C:\vfunction\config\installation\instances\default-java\installation.yaml
  1. Modify the agent.disable_jdbc settings:
### Before
agent:
  disable_jdbc: false


### After
agent:
  disable_jdbc: true
  1. Run the upgrade.sh script
  • Linux Sudo sample upgrade flow: sudo bash /opt/vfunction/controller-installation/upgrade.sh -i default-java
  • Linux Sudoless sample upgrade flow: bash /tmp/vfunction/opt/vfunction/controller-installation/upgrade.sh -i default-java
  • Windows sample upgrade flow: powershell -NoProfile -ExecutionPolicy unrestricted -Command “C:\vfunction\controller-installation\upgrade.ps1 -instance default-java”
  1. Unexpectedly, the organization still does not see Database Tables in the Resources Report after a new round of smoke testing
  2. The organization already has an OpenTelemetry Agent that they are using as opposed to a scenario where the vFunction OpenTelemetry Agent is used

Configure an existing OpenTelemetry Agent

Take the following steps to configure the OpenTelemetry Agent to send Database Tracking information to the vFunction Agent so the details can be displayed in the vFunction UI:

  1. Confirm the JVM Startup parameters contain a reference to the -javaagent:/PATH/TO/opentelemetry-javaagent.jar
  2. Add the following JVM Startup parameters to the existing list of flags:
-Dotel.exporter.otlp.protocol=http/protobuf
-Dotel.instrumentation.common.default-enabled=false
-Dotel.instrumentation.jdbc.enabled=true
-Dotel.instrumentation.mongo.enabled=true
  1. Run the upgrade.sh script
  • Linux Sudo sample upgrade flow: sudo bash /opt/vfunction/controller-installation/upgrade.sh -i default-java
  • Linux Sudoless sample upgrade flow: bash /tmp/vfunction/opt/vfunction/controller-installation/upgrade.sh -i default-java
  • Windows sample upgrade flow: powershell -NoProfile -ExecutionPolicy unrestricted -Command “C:\vfunction\controller-installation\upgrade.ps1 -instance default-java”
  1. Start Learning in the vFunction Server UI and perform smoke testing to confirm Database Tables are visible