Correlate Application Containers with App Agents (For Kubernetes version>=1.25)

Note: The Java Agent depends on the HOSTNAME environment variable, using it as the pod name to query the Cluster Agent. It is important to keep these variables unchanged to accurately extract the container ID.

When you establish application correlation with the agents, the monitored application containers are displayed in the Controller under the Application/Container view. The Cluster Agent Pod Dashboard also provides a link to the APM Node Dashboard in the Pod Details page. To enable APM and container correlation during auto-instrumentation, you must configure the containerAppCorrelationMethod property under the spec section in the configuration file. This property is applicable for the environments that use Kubernetes>=1.25 because from Kubernetes 1.25 onwards, support for cgroup v1 runtimes are replaced by cgroup v2 enabled runtimes.

You can choose one of the following values for the correlation method:

  • proxy (recommended): This is the default value. When you specify this value, the App agents query for the container ID from the Cluster Agent.
  • none: When you specify this value, there is no correlation.

Example

apiVersion: cluster.appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
  name: k8s-cluster-agent
  namespace: appdynamics
spec:
  containerAppCorrelationMethod: proxy
  appName: "<cluster-name>"
  controllerUrl: "<protocol>://<appdynamics-controller-host>:8080"
  account: "<account-name>"
  image: "docker.io/appdynamics/cluster-agent:20.12.1"
  serviceAccountName: appdynamics-cluster-agent
  nsToMonitorRegex: ecom.*
  #
  # auto-instrumentation config
  #
  instrumentationMethod: Env
  nsToInstrumentRegex: ecom.*
  defaultAppName: Ecommerce
  instrumentationRules:
    - language: java
      imageInfo:
        image: docker.io/appdynamics/java-agent:20.20.1
        agentMountPath: /opt/appdynamics