Phase 2: Enable Dual Signal Mode
2. Enable Dual Mode
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 appTip
Ifkill %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 #
| Flag | Purpose |
|---|---|
-Dagent.deployment.mode=dual | Enables dual signal mode the full OTel Java auto-instrumentation runs alongside the AppD agent |
-Dotel.traces.exporter=otlp | Tells the OTel instrumentation to export spans via OTLP |
-Dotel.exporter.otlp.endpoint | Points to the local OTel Collector on port 4318 (HTTP/protobuf) |
-Dotel.resource.attributes | Sets 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"text
splunk@ip-172-31-77-108 ~/workshop/appd $ ps aux | grep "deployment.mode=dual" | grep -v grep
splunk 181598 172 2.1 14402900 717736 pts/0 SNl 21:31 1:02 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=Dual-Ingest-shw-1123 -Dappdynamics.agent.tierName=OrderService -Dappdynamics.agent.nodeName=OrderService-Node -Dappdynamics.agent.accountName=se-lab -Dappdynamics.agent.accountAccessKey=hj9999999999 -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-shw-a79e,deployment.environment=shw-a79e-appd-dual -jar app/target/ingest-workshop-1.0.0.jarYou should see the java process with the deployment.mode=dual flag.
The AppDynamics agent is now sending:
- AppD APM data to the AppDynamics Controller (unchanged)
- OTLP traces to the local OTel Collector on
localhost:4318, which forwards to Splunk Observability Cloud- use
envin your instance to see the{INSTANCE}value used for your environmentdeployment.environment=${INSTANCE}-appd-dual
- use
