- 14 Apr 2022
- 1 Minute to read
- Print
- DarkLight
- PDF
JVM
- Updated on 14 Apr 2022
- 1 Minute to read
- Print
- DarkLight
- PDF
You can install Traceable Java Agent in a Kubernetes environment. When you run the commands mentioned below, they automatically instrument any application in the namespace running in the JVM. Following is the compatibility matrix to make sure that you choose the right option.
Supported frameworks
Library/Framework | Versions |
---|---|
Apache HttpAsyncClient | 4.1+ |
Apache HttpClient | 4.0+ |
gRPC | 1.6+ |
JAX-RS Client | 2.0+ |
Micronaut (basic support via Netty) | 1.0+ |
Netty | 4.0+ |
OkHttp | 3.0+ |
Servlet | 2.3+ |
Spark Web Framework | 2.3+ |
Spring Webflux | 5.0+ |
Vert.x | 3.0+ |
Struts | 2.3+ |
Install Java agent
Complete the following steps to install the Java agent. Make sure that you have identified the namespace in which you would like to auto inject the agent.
- Enter the following command to label the namespace
kubectl label namespace $NAMESPACE traceableai-inject-java=enabled
- Enter the following command to annotate the Java deployment
kubectl patch deployment.apps/<JAVA_DEPLOYMENT> -p '{"spec": {"template": {"metadata": {"annotations": {"java.traceable.ai/inject": "true"}}}}}' -n <NAMESPACE>
- Restart the deployments in that namespace so that the Traceable platform agent can inject the Java agent into your deployment:ActionScript
kubectl rollout restart deployment -n <NAMESPACE>
Verify
Check that the pods in the namespace have been injected with the Java agent by running the following command and verifying there is a traceable-javaagent-init
initContainer.
kubectl describe pod <POD> -n <NAMESPACE>
...
Init Containers:
traceable-javaagent-init:
Container ID: docker://a71000bd5bc2eab1f03c76c3156f6c8105c64b5baaa2c3ef1fce9434cd62aed5
Image: traceableai/javaagent:1.0.0
...