Skip to main content

Installing the Java agent using the buildpack

If you are building an executable Docker image with the Java application using Gradle, you can use the buildpack to install the agent.

Basic settings of the WhaTap buildpack

tasks.named("bootBuildImage") {
buildpacks = ["urn:cnb:builder:paketo-buildpacks/java",

Configuring options

Only when the WhaTap collection server is connected, data can be collected. The access key (accesskey) and WhaTap collection server address ( are required. Additional options can be set according to the needs for the environment and functions.

tasks.named("bootBuildImage") {
// Whatap
environment["BP_WHATAP_ENABLED"] = "true"
// java 17, There must be a space at the beginning.
environment["BPE_APPEND_JAVA_TOOL_OPTIONS"] = " --add-opens=java.base/java.lang=ALL-UNNAMED "
// add multi options, delimeter is linefeed character
environment["BP_WHATAP_OPTIONS"] = "accesskey=aaa-bbb-ccc\"

buildpacks = ["urn:cnb:builder:paketo-buildpacks/java", ""]

    Set whether or not to enable the WhaTap agent. If the value is false, installation is performed but started with monitoring stopped. You can change it to true in Management> Agent CONF. in Whatap Monitoring Service later.


    If you are using Java 17 or later, add the JVM option.

    environment["BPE_DELIM_JAVA_TOOL_OPTIONS"] = " "
    environment["BPE_APPEND_JAVA_TOOL_OPTIONS"] = "--add-opens=java.base/java.lang=ALL-UNNAMED"

    Add spaces before and after if you are not using the delimiter environment variable.

    environment["BPE_APPEND_JAVA_TOOL_OPTIONS"] = " --add-opens=java.base/java.lang=ALL-UNNAMED "

    You can add the WhaTap agent settings. Set options with linefeed "\n" as the delimiter. The option is key=value. The set option values are saved in the whatap.conf file during the Docker Image creation step.

    environment["BP_WHATAP_OPTIONS"] = "accesskey={access key}\{collection server address}"
    // Example: environment["BP_WHATAP_OPTIONS"] = "accesskey=aaa-bbb-ccc\"

Tomcat 10 environment

In the Tomcat environment, the weaving=tomcat10 option must be added.

environment["BP_WHATAP_OPTIONS"] = "accesskey={access key}\{collection server address}\nweaving=tomcat10"

Container execution option

When running the container, you can set the access key and WhaTap collection server address as environment variables as follows.

docker run --rm -p 8080:8080 \
-e accesskey={access key} \
-e{collection server address} \
-e weaving=tomcat10,webflux-6.0 \