In this cookbook, the full APM agent is installed inside the container image of the application, which is a Java web application based on Java Spring Boot framework. The APM observability features allow to monitor the instance and profile every transaction.
- a SaaS account for APM
- a Docker host, for example Docker Desktop
In the APM webconsole, navigate to CONFIGURE > AGENTS > Install Agents to see the Agent Installation Steps section.
- Find your Customer Id, for example 12341234-12341234-13241234
- Find the SaaS Analysis Server Host, for example agents.apm.my_environment.aternity.com
- Download the latest APM agent for Linux package (also available on Riverbed support), appinternals_agent_latest_linux.gz
Then in CONFIGURE > AGENTS > Configurations,
- Define a configuration for the app and download the .json file. For example create a new configuration and name it "configuration", configure Data Collection Settings to enable End-User Experience Data collection, Save and Download the file configuration.json
- Download the cookbook. For example download the zip of the repository, expand it and go the folder Tech-Community/203-instrument-java-app-with-apm-agent-in-container
- Copy the agent package appinternals_agent_latest_linux.gz in the subfolder apm-customization.
- Copy the configuration file (prepared in Step 1.) to the subfolder apm-customization/config.
⚠️ if the name of the configuration file is not configuration.json then edit the initial-mapping to adapt the startup autoinstrumentation mapping
Start the containers using docker-compose, 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_SERVER_HOST="agents.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_SERVER_HOST="agents.apm.myaccount.aternity.com"
$env:RIVERBED_APM_CUSTOMER_ID="12341234-12341234-13241234"
docker-compose up
The web application should now be available on http://localhost:8080.
Open the url in your browser and refresh the page few times to generate some traffic.
Go to the APM webconsole to monitor the instance and observe every transaction.
Copyright (c) 2023-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.