This cookbook starts with a Java demo application that runs in a Linux container. For Observability, the APM agentless for Java (the APM Java agent library for Linux) is containerized in the same container to instrument the application.
The Java application is the Spring PetClinic web app, framework version.
- a SaaS account for APM
- a Docker host, for example Docker Desktop
In the APM webconsole, navigate to CONFIGURE > AGENTS > Install Agents and in the Agent Installation Steps section,
- Find your Customer Id, for example 12341234-12341234-13241234
- Find the SaaS Analysis Server Host and obtain the SaaS Psockets Server host replacing agents by psockets. For example if the analysis server host is agents.apm.my_environment.aternity.com then the SaaS Psockets Server host is psockets.apm.my_environment.aternity.com
- Download the package APM Agentless Instrumentation (Java) (also available on Riverbed support, for example aternity-apm-jida-linux-12.19.0_BL516
-
Save the package of the APM Java agent for Linux in local folder, for example in "Tech-Community/202-instrument-java-app-with-apm-agentless-in-container)", and rename the file as aternity-apm-jida-linux.zip - just removing the suffix part that is the version number.
-
Download the Dockerfile/Dockerfile).
In the command below, replace the value with your own info (see Step 1):
- Customer Id, for example 12341234-12341234-13241234
- SaaS Psockets Server host, for example psockets.apm.myaccount.aternity.com
For example with Bash:
cd Riverbed-Community-Toolkit/APM/203-instrument-java-app-with-apm-agent-in-container
# Configure the environment variables with the SAAS Account details
export RIVERBED_APM_SAAS_PSOCKETS_SERVER_HOST="psockets.apm.myaccount.aternity.com"
export RIVERBED_APM_CUSTOMER_ID="12341234-12341234-13241234"
docker-compose up
or with PowerShell:
cd Riverbed-Community-Toolkit/APM/203-instrument-java-app-with-apm-agent-in-container
# Configure the environment variables with the SAAS Account details
$env:RIVERBED_APM_SAAS_PSOCKETS_SERVER_HOST="psockets.apm.myaccount.aternity.com"
$env:RIVERBED_APM_CUSTOMER_ID="12341234-12341234-13241234"
docker-compose up
In the command below replace the value of the environment variable with your own info (see Step 1):
- Customer Id in the variable RVBD_CUSTOMER_ID, for example 12341234-12341234-13241234
- SaaS Psockets Server host in the variable RVBD_ANALYSIS_SERVER, for example psockets.apm.myaccount.aternity.com
docker build --tag cookbook-202 .
docker run --rm -p 8080:8080 -e RVBD_CUSTOMER_ID="1234-12341243" -e RVBD_ANALYSIS_SERVER="psockets.apm.myaccount.aternity.com" cookbook-202
The web application should now be available on http://localhost:8080.
Then, open the url in your browser and refresh the page few times to generate some traffic.
Go to the APM webconsole to observe the transactions of that instance.
Copyright (c) 2022-2024 Riverbed
The contents provided here are licensed under the terms and conditions of the MIT License accompanying the software ("License"). The scripts are distributed "AS IS" as set forth in the License. The script also include certain third party code. All such third party code is also distributed "AS IS" and is licensed by the respective copyright holders under the applicable terms and conditions (including, without limitation, warranty and liability disclaimers) identified in the license notices accompanying the software.