Validate Auto-Instrumentation
This page describes how to validate and troubleshoot Cluster Agent auto-instrumentation.
Prerequisites
- Cluster Agent is reporting to the Controller. See Validate the Cluster Agent Installation.
- If you upgraded the Cluster Agent, you followed the Upgrade the Cluster Agent procedure and used a compatible set of images and YAML files.
Validate Auto-Instrumentation
Troubleshoot Auto-Instrumentation When Not Applied
[DEBUG]: 2021-03-30 21:22:10 - instrumentationconfig.go:645 - rule stage matches Deployment spring-boot-multicontainer in namespace stage with labels map[appName:jah-stage acme.com/framework:java]
[DEBUG]: 2021-03-30 21:22:10 - instrumentationconfig.go:656 - Found a matching rule {stage map[acme.com/framework:[java]] java select .* JAVA_TOOL_OPTIONS map[agent-mount-path:/opt/appdynamics image:docker.io/appdynamics/java-agent:21.3.0 image-pull-policy:IfNotPresent] map[bci-enabled:true port:3892] 0 0 appName 0 false []} for Deployment spring-boot-multicontainer in namespace stage with labels map[appName:jah-stage acme.com/framework:java]
[DEBUG]: 2021-03-30 21:22:10 - instrumentationconfig.go:249 - Instrumentation state for Deployment spring-boot-multicontainer in namespace stage with labels map[appName:jah-stage acme.com/framework:java] is true
[DEBUG]: 2021-03-30 21:22:10 - deploymenthandler.go:312 - Added instrument task to queue stage/spring-boot-multicontainer
Troubleshoot Auto-Instrumentation When it Fails to Complete
Troubleshoot Re-instrumentation Issues for Upgraded Deployment
- When you edit the deployment specification using Helm upgrade, the Cluster Agent does not re-instrument the upgraded deployment. If your changes to Cluster Agent-applied specification interferes with instrumentation properties, instrumentation stops working.This issue occurs mostly in case of Java instrumentation, when your Java application uses
JAVA_TOOL_OPTIONS
and there is a possibility that helm upgrade results in overridingJAVA_TOOL_OPTIONS
environment variable in the deployment specification.The overriding happens because the Java Agent uses this environment variable to consume the system properties, causing instrumentation to fail. - Cluster Agent uses annotations to check the instrumentation state of the deployment. The annotations on the deployment are not updated when the deployment tool or script uses the edit or the patch Kubernetes APIs to edit the deployment specification. Therefore, when there is no change in the instrumentation state the re-instrumentation does not happen.
You can workaround this issue by removing the annotation
APPD_DEPLOYMENT_INSTRUMENTATION_STATE
on the deployment specification.