LLM Java Agent Installation
The AI Agent Observability Java agent traces Spring AI-based LLM calls. Download the agent JAR, add the -javaagent option to your JVM startup, and specify the Spring AI version via the weaving option in whatap.conf. For supported environments, see AI Agent Observability Supported Environment.
Download agent
After issuing an access key, go to the Download agent section. Run the following command to download the agent.
wget https://api.whatap.io/agent/whatap.agent.java.tar.gz
If you cannot download via the wget command, use the download button in the console to get the installation file. Extract the downloaded file.
tar xzvf whatap.agent.java.tar.gz
Set JVM options
In Java 9 or later, some agent features may be restricted due to module security policies. Add the following to the JVM startup options.
--add-opens=java.base/java.lang=ALL-UNNAMED
Add the -javaagent option according to your OS.
- Linux
- Windows
########## WHATAP START ############
WHATAP_HOME={extracted path}/whatap
WHATAP_JAR=`ls ${WHATAP_HOME}/whatap.agent-*.jar | sort -V | tail -1`
JAVA_OPTS="${JAVA_OPTS} -javaagent:${WHATAP_JAR} "
########## WHATAP END ############
Or you can specify the path directly.
-javaagent:{agent installation path}/whatap.agent-X.Y.Z.jar
rem ########## WHATAP START ############
set WHATAP_HOME={extracted path}\whatap
for /f %%f in ('dir /b /on "%WHATAP_HOME%\whatap.agent-*.jar"') do set last=%%f
set WHATAP_JAR=%last%
set WHATAP_OPTS=-javaagent:%WHATAP_HOME%\%WHATAP_JAR%
if "x%JAVA_OPTS%"=="x" goto setWhatap
set JAVA_OPTS_TMP=%JAVA_OPTS:"=%
if not "x%JAVA_OPTS_TMP:whatap=%"=="x%JAVA_OPTS_TMP%" goto endWhatap
:setWhatap
set JAVA_OPTS=%JAVA_OPTS% %WHATAP_OPTS%
:endWhatap
rem ########## WHATAP END ############
Or you can specify the path directly.
-javaagent:{agent installation path}\whatap.agent-X.Y.Z.jar
Configure agent
Set access key and collection server IP
Set the access key and collection server IP in the whatap.conf file.
license={ACCESS_KEY}
whatap.server.host={COLLECTION_SERVER_IP}
Set weaving by Spring AI version
Add the weaving option matching your Spring AI version to whatap.conf.
# Spring AI 2.0.0 M1 ~ M2
weaving=spring-ai-2.0
# Spring AI 2.0.0 M3
weaving=spring-ai-2.0-m3
After completing the configuration, restart the application.