Phase 2: Enable Dual Signal Mode

2. Enable Dual Mode

2 min

Now restart the application with dual signal mode flags added to the JVM command line.

Stop the Running Application

Stop the app and load generator from Phase 1:

bash
kill %2 2>/dev/null   # stop load generator
kill %1 2>/dev/null   # stop the java app

Tip

If kill %1 doesn’t work, find the PID with ps aux | grep ingest-workshop and kill it directly.

Restart with Dual Mode

Run the app again with the same AppD flags, plus the dual mode and OTel exporter flags. We will leverage the variables we set for ${APPD_ACCESS_KEY} and ${APPD_APP_NAME} with the same values you used in Phase 1:

We are adding 4 lines just before we invoke the application -jar app/target/ingest-workshop-1.0.0.jar &

bash
cd ~/workshop/appd

java -javaagent:agent/javaagent.jar \
  -Dappdynamics.controller.hostName=se-lab.saas.appdynamics.com \
  -Dappdynamics.controller.port=443 \
  -Dappdynamics.controller.ssl.enabled=true \
  -Dappdynamics.agent.applicationName=${APPD_APP_NAME} \
  -Dappdynamics.agent.tierName=OrderService \
  -Dappdynamics.agent.nodeName=OrderService-Node \
  -Dappdynamics.agent.accountName=se-lab \
  -Dappdynamics.agent.accountAccessKey=${APPD_ACCESS_KEY} \
  -Dagent.deployment.mode=dual \
  -Dotel.traces.exporter=otlp \
  -Dotel.exporter.otlp.endpoint=http://localhost:4318 \
  -Dotel.resource.attributes=service.name=OrderService,service.namespace=Dual-Ingest-${INSTANCE},deployment.environment=${INSTANCE}-appd-dual,deployment.environment.name=${INSTANCE}-appd-dual \
  -jar app/target/ingest-workshop-1.0.0.jar &

Wait for the Spring Boot startup banner to appear. Press return to go back to your prompt.

What the new flags do

FlagPurpose
-Dagent.deployment.mode=dualEnables dual signal mode the full OTel Java auto-instrumentation runs alongside the AppD agent
-Dotel.traces.exporter=otlpTells the OTel instrumentation to export spans via OTLP
-Dotel.exporter.otlp.endpointPoints to the local OTel Collector on port 4318 (HTTP/protobuf)
-Dotel.resource.attributesSets OTel resource attributes: service.name maps to the AppD tier, service.namespace maps to the AppD application, deployment.environment/deployment.environment.name tags data for your workshop instance

Restart the Load Generator

bash
while true; do
  curl -s localhost:8080/order > /dev/null
  curl -s localhost:8080/inventory > /dev/null
  sleep 2
done &

Verify Dual Mode is Active

Check the application logs for confirmation that dual mode started:

bash
ps aux | grep "deployment.mode=dual"

You should see the java process with the deployment.mode=dual flag.

The AppDynamics agent is now sending:

Last Modified ·