Download PDF
Download page Auto-Instrumentation Configuration.
Auto-Instrumentation Configuration
This page describes the properties available in the cluster-agent.yaml
and the Helm values.yaml
file that you can use to configure auto-instrumentation.
Configuration Structure for Auto-Instrumentation
The structure of the auto-instrumentation configuration is based on a set of default properties, which you can override by using properties defined in one or more instrumentationRules
.
apiVersion: cluster.appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
name: k8s-cluster-agent
namespace: appdynamics
spec:
# cluster agent properties
# ...
# required to enable auto-instrumentation
instrumentationMethod: Env
# default auto-instrumentation properties
# may be overridden in an instrumentationRule
nsToInstrumentRegex: dev|stage|prod
enableInstallationReport: false
image: "docker.io/appdynamics/java-agent:21.7.0"
# ...
# one or more instrumentationRules
instrumentationRules:
- nsToInstrumentRegex: dev
imageInfo:
image: "docker.io/appdynamics/java-agent:21.3.1"
agentMountPath: /opt/appdynamics
imagePullPolicy: Always
# ...
- nsToInstrumentRegex: stage
imageInfo:
image: "docker.io/appdynamics/java-agent:21.5.0"
agentMountPath: /opt/appdynamics
imagePullPolicy: Always
# ...
deploymentMode: MASTER
# cluster agent properties
# ...
clusterAgent:
nsToMonitorRegex: .*
# ...
# Instrumentation config
instrumentationConfig:
enabled: true
# required to enable auto-instrumentation
instrumentationMethod: Env
# default auto-instrumentation properties
# may be overridden in an instrumentationRule
nsToInstrumentRegex: dev|stage|prod
image: "docker.io/appdynamics/java-agent:21.7.0"
# ...
# one or more instrumentationRules
instrumentationRules:
- nsToInstrumentRegex: dev
imageInfo:
image: "docker.io/appdynamics/java-agent:21.3.1"
agentMountPath: /opt/appdynamics
imagePullPolicy: Always
# ...
- nsToInstrumentRegex: stage
imageInfo:
image: "docker.io/appdynamics/java-agent:21.5.0"
agentMountPath: /opt/appdynamics
imagePullPolicy: Always
# ...
Overriding Default Properties with InstrumentationRules
The Cluster Agent uses a combination of namespaceRegex
, matchString,
and labelMatch
properties in an InstrumentationRule
to target Deployments
, DeploymentConfigs
and StatefulSets
in a namespace for auto-instrumentation. The first matching InstrumentationRule
is used. If no matching rule is found, then the default properties are used to determine if auto-instrumentation should be applied:
nsToInstrumentRegex
defaultInstrumentationLabelMatch
defaultInstrumentMatchString
For example, the following InstrumentationRule
with -matchString
"<string>"
is added to the Cluster Agent configuration file:
|
You must have a deployment for auto-instrumentation to work.
If the deployment name matches this string, then the remaining properties under the matching instrumentationRule
are applied and will override any default properties that are set. If the string does not match, then the Cluster Agent defaults to the properties nsToInstrumentRegex, defaultInstrumentationLabelMatch
, and defaultInstrumentMatchString
to determine the instrumentation rules.
Use Custom Access Key
You can create custom access key and use for a specific license rule that you create in Controller for the instrumenting applications. Perform the following to use Custom Access Key based on the rules you have defined for a tenant:
- Create required License Rule.
This generates a key. Run the following command to create the custom secret using the key generated in step 1:
kubectl -n appdynamics create secret generic <secret-name> --from-literal=<custom-Controller-key-name>=<key-value>
CODEAdd the following configuration under Instrumentation Rules:
customSecretName: <generated-secret-name> customSecretKey: <generated-key>
CODE
Ensure that you provide the correct secret name and key values in the cluster-agent.yaml
file for auto-instrumentation. If the values are incorrect, you cannot monitor the applications.
If you have auto-instrumented the applications and require to update the secret later, you require to set the enableForceReInstrumentation
parameter to true
during the re-instrumentation process.
This restarts Cluster Agent.
Common Auto-Instrumentation Tasks
These properties are available to support common auto-instrumentation configuration tasks:
To set the namespaces that are in scope for auto-instrumentation:
nsToInstrument
nsToInstrumentRegex
- (Optional) To filter and target the set of applications within a namespace that are in scope for auto-instrumentation:
instrumentationMatchString
labelMatch
- To assign an application and tier name to an instrumented application:
appNameStrategy
tierNameStrategy
tierName
See Application Naming Strategies.
- To instrument which containers are in a multi-container application:
instrumentContainer
containerMatchString
TheinstrumentContainer
default is to instrument the first container based on the ordering returned by the Kubernetes API.
- If transaction analytics is required for Node.js applications, then specify the analytics host and port:
analyticsHost
analyticsPort
See Deploy Analytics Without the Analytics Agent. Configuration of transaction analytics is not required for .NET and Java applications. You can deploy the Analytics Agent using the sidecar model where you add an Analytics Agent container to each application pod, and then start/stop with the application container. If you use the sidecar approach, the App Server Agent uses the default hostlocalhost
and port9090
and connects automatically. No additional configuration is required. See Install Agent Side Components in Kubernetes.
Default Auto-Instrumentation Properties
This table describes the default properties available to configure auto-instrumentation, defined in the cluster-agent.yaml
spec:
Parameter Name | Default Value | Description |
---|---|---|
appNameLabel | N/A | The value of this label will be the Splunk AppDynamics application name. |
appNameStrategy | manual | The option to specify a name for the Splunk AppDynamics application. You can specify any of these values for this parameter:
|
defaultAnalyticsHost | N/A | The hostname of the Analytics Agent. This parameter is required if you require the Node.js Agent to send the default transaction data to the Analytics Agent. The default value is applied to all instrumented resources unless it is overwritten by the |
defaultAnalyticsPort | N/A | The listening port for Analytics Agent. For example, if the Analytics Agent is listening on port 9090, then the value of this parameter is The default value is applied to all instrumented resources unless it is overwritten by the This parameter is required with |
defaultAnalyticsSslEnabled | N/A | This value is based on whether the Analytics Agent port is SSL enabled. If the port is SSL enabled, specify the value as This parameter is required with The default value is applied to all instrumented resources unless it is overwritten by the |
| "" | (Required) Application name used by the agent to report to the Controller. |
defaultCustomConfig | N/A | This parameter is specific to Java applications. You can add any custom system property if your application framework requires any specific configuration for instrumentation. This value is appended to the When you upgrade your deployment using Helm, you can use this parameter instead of defaultEnv to avoid re-instrumentation issues. See Troubleshoot Re-instrumentation Issues for Upgraded Deployment under Validate Auto-Instrumentation. |
defaultContainerMatchString | N/A | This is a regex value to choose the containers to instrument. This parameter requires you to use the When the |
| JAVA_TOOL_OPTIONS | This parameter is specific to Java applications. Environment variable to which the - You can override this variable to use any other environment variable best suited for the deployment. However, if you override this value for upgrading the deployment, Cluster Agent does not re-instrument. This happens because both Java Agent and the deployment uses For more information to troubleshoot, see Troubleshoot Re-instrumentation Issues for Upgraded Deploymentunder Validate Auto-Instrumentation. |
| [ ] | Specific deployment labels marked for instrumentation. This parameter accepts a list of You must match a minimum of one label for instrumentation. For example:
For example, if only |
| .* | Names of deployments targeted for instrumentation. This parameter is used as the default value for the This parameter accepts deployment names as a regular expression or regex. If there are multiple deployments to instrument, you can separate names with a ' By default, this parameter instruments all deployments configured by |
enableForceReInstrumentation | false | This property needs to be set to true if the newly introduced instrumentation properties should overwrite the old configuration on the successfully instrumented pods. By default this property is set to false. Set the value to true if you require Set the value to false if you require to retain the instrumentation configuration to the successfully instrumented deployment. However, updated configurations will be applied if the instrumentation state of the existing deployment is either failed or new. When you upgrade Cluster Agent you must set this value to true to apply the updated configurations to the successfully instrumented deployment. |
enableInstallationReport | "false" | Enables or disables the collection of installation information. It generates a summarized report with the following details:
To view the installation report, see View Installation Report. |
|
CODE
CODE
CODE
| The Docker repository from where the Node.js Agent, .NET Core for Linux, and Java Agent is pulled. Supported values are:
|
| None | The instrumentation method used for instrumenting Apps. Supported values are:
|
|
| Required. This parameter is used to enable auto-instrumentation. |
| N/A | Secret name for Java Agent SSL keystrore file. For more information, see Use Custom SSL for Java Agent Auto-Instrumentation. |
| N/A | Secret name for Java Agent SSL keystrore password. For more information, see Use Custom SSL for Java Agent Auto-Instrumentation. |
| "" | Required. If you do not specify a value, auto-instrumentation will not work. Specify the namespaces to be instrumented as a regex. If there are multiple namespaces to instrument, separate namespaces using "|" without spaces. By default, namespaces are not instrumented. |
numberOfTaskWorkers | 2 | To configure the rate limit for the number of deployments that are auto-instrumented at the same time. Increasing this value may lead to a larger number of concurrent pod restarts in the cluster. |
|
| To configure the Network Visibility App Agent, By default, Supported values are:
|
| 0 | If you configured the application container as a non-root user, provide the group ID (GID) of the corresponding group.
The default |
| 0 | If you configured the application container as a non-root user, provide the user ID (UID) of the corresponding user.
The default |
resourcesToInstrument | Deployment | Cluster Agent instruments the resources that are listed in this parameter. The supported values are:
For example, to instrument
|
tierNameLabel | N/A | The value of this label will be the Splunk AppDynamics tier name. |
tierNameStrategy | manual | The option to specify a name for the tier. You can specify any of these values for this parameter:
|
View the Installation Report
You can view the summarized installation report if you have enabled the enableInstallationReport
parameter in the cluster-agent.yaml
file. See Default Auto-Instrumentation Properties. Perform the following steps to view the installation report:
Run the kubectl
exec
command to get to the Cluster Agent pod.kubectl exec -it <cluster-agent-pod-name> -n <namespace> sh
CODE- Navigate to the logs directory.
- Open the
InstallationReport.csv
file to view the report.
Use Custom SSL for Java Agent Auto-Instrumentation
You can use the following properties in the default cluster-agent.yaml file to specify the secret for the Keystore file and password. This enables Java Agent auto-instrumentation with custom SSL.
- javaAgentCustomSSLKeystore
- javaAgentCustomSSLKeystorePasswordSecret
To use these properties, you must use the JKS format for the Custom SSL certificate and name the file as custom-ssl.jks
. For information about creating certificates, see Enable SSL for the Java Agent.
Run the following commands to create secrets, which is used for the auto-instrumentation of Java Agent with custom SSL.
- Create secret for keystore file.
kubectl -n appdynamics create secret generic <secret name> --from-file=<path to custom-ssl.jks file>
CODE - Create secret for the keystore password.
kubectl -n appdynamics create secret generic <secret name> --from-literal=keystore-password=‘<keystorePassword>’
CODE
Update Secrets After Certificate Update
If you change the custom SSL keystore file or the keystore password, you require to perform the following:
- Uninstrument Java application.
- Create new secret for keystrore file and keystrore password. See Use Custom SSL for Java Agent Auto Instrumentation.
- Re-instrument Java application.
InstrumentationRule Properties
This table describes the properties available to configure auto-instrumentation in an InstrumentationRule
.
Parameter Name | Default Value | Description |
---|---|---|
analyticsHost | N/A | The hostname of the Analytics Agent. This parameter is required if you require the Node.js Agent or the .NET Core Agent to send the default transaction data to the Analytics Agent. |
analyticsPort | N/A | The listening port for Analytics Agent. For example, if the Analytics Agent is listening on port 9090, then the value of this parameter is This parameter is required with |
analyticsSslEnabled | N/A | This value is based on whether the Analytics Agent port is SSL enabled. If the port is not SSL enabled, specify the value as This parameter is required with |
containerMatchString | N/A | This is a regex value to choose the containers with the name that satisfies the value. This parameter requires you to use the When the This parameter overrides the default value specified for |
customAgentConfigSource | N/A | This parameter provides an option to use the custom configuration of the instrumenting agents through ConfigMaps. This parameter requires that you create the required ConfigMaps in the Cluster Agent namespace. This parameter is dynamically configurable from the Cluster Agent YAML file. The changes that you make in the YAML file are updated to all the instrumented agents without restarting the application. Similarly, the changes that you make to the configuration in the ConfigMap is updated to all the instrumented agents without restarting the application.
If you need to remove a ConfigMap file (used in the rules) from your deployment, then you must first remove this parameter from the Cluster Agent YAML file, and then remove the ConfigMap from the Cluster Agent's namespace. |
customSecretName | N/A | The custom secret name. This is the same name that is generated when you define the license rule. |
customSecretKey | N/A | The custom secret key. This is the same key that is generated when you define the license rule. |
| first | This parameter provides an option to choose the container that must be instrumented. You can specify any of these values:
|
language | N/A | The language of the application to be instrumented. These languages are supported:
|
matchString | N/A | Regular expression to match on deployment name on which the rule applies. If you do not specify a value for this parameter, then the Cluster Agent uses the value specified in the |
namespaceRegex | "" | Regular expression to specify the namespaces that are to be instrumented as part of this rule. You can separate namespaces using the pipe symbol (|) without any spaces. |
labelMatch | {} | A list of key-value pairs of labels to include in this rule. It is sufficient to match any one of the labels.For example: |
appName | <defaultAppName > | Application name used by the Java Agent to report to the Controller. This overrides If no value is provided, then the configured |
appNameLabel | N/A | The value of this label is the Splunk AppDynamics application name. |
customAgentConfig | N/A | This parameter is specific to Java and Node.js applications. You can add any custom system property if your application framework requires any specific configuration for instrumentation. For Java applications: This value is appended to the For Node.js applications: This value is appended to |
tierName | "" | Tier name used by the Java Agent to report to the Controller. If no tier name is provided, then the deployment name is used as the default if the tier name strategy is manual. |
tierNameLabel | N/A | The value of this label is the Splunk AppDynamics tier name. |
nodeName | "" | This parameter is used to sequentially name a node under a tier. If no node name is provided, then the deployment name is used as the default. For example, consider that there are two nodes used within a tier and your application environment uses the deployment name as abc . If you do not specify the value for the node name in the configuration file, then Cluster Agent takes into account the following node names:
|
reuseNodeName | true | This parameter is applicable only for Java Agent. Set this property to |
env | "" | This parameter is specific to Java applications. Environment variable to which the App Agent system properties will be added. When specified, this overrides If none are provided, it defaults to the |
imageInfo |
CODE
CODE
CODE
| You can select one of these properties:
For the specific language mentioned in this rule, this overrides You must configure this if you want to override the default cluster-level configuration and use a custom agent version for this specific rule selection. |
|
| To configure the Network Visibility App Agent, By default, Supported values are:
|
| 0 | If you configured the application container as a non-root user, provide the This sets the appropriate file permission on the agent artifacts. This value is applied to all the instrumented resources. Add this parameter, if you require to override the default value of |
| 0 | If you configured the application container as a non-root user, it provides the This sets the appropriate file permission on the agent artifacts. This value is applied to all the instrumented resources. Add this parameter, if you require to override the default value of |
| NA | Specify the required security context constraint parameters. For the list of parameters that can be used within securityContext, see securityContext Parameters. |
SecurityContext Parameters
You can use the following parameters within the securityContext
parameter:
For OpenShift version > 4.14
, ensure that all the child parameters within securityContext are specified based on the permissible values outlined by the security context constraints (SCCs). See Managing Security Context Constraints in the Red Hat OpenShift documentation.
For example, if you want to use RunAsUser
property in instrumentation rule then user ID (UID) should be in the permissible range. The SCCs permissible range for UID is 1000
to 9001. Therefore, you can add RunAsUser
value within this range only. The same applies for other security context parameters.
Parameter Name | Default Value | Description |
---|---|---|
| 0 | If you configured the application container as a non-root user, provide the This sets the appropriate file permission on the agent artifacts. This value is applied to all the instrumented resources. Add this parameter, if you require to override the default value of |
| 0 | If you configured the application container as a non-root user, it provides the userId of the corresponding user. This sets the appropriate file permission on the agent artifacts. This value is applied to all the instrumented resources. Add this parameter, if you require to override the default value of |
allowPrivilegeEscalation | NA | To control if a process can get more privileges than its parent process. The value is true when the container runs as:
|
capabilities | NA | To add or remove POSIX capabilities from the running containers. This uses the default set of capabilities during container runtime.
|
privileged | False | To run container in privileged mode, which is equivalent to root on the host.
|
procMount | DefaultProcMount | The type of proc mount to use for the containers. This parameter is currently available for Deployment and DeploymentConfig mode. |
readOnlyRootFilesystem | False | To specify if this container has a read-only root filesystem.
|
runAsNonRoot | False | To specify if the container must run as a non-root user. If the value is true, the Kubelet validates the image at runtime to ensure that the container fails to start when run as root. If this parameter is not specified or if the value is false, there is no validation. This parameter is currently available for Deployment and DeploymentConfig mode. |
seLinuxOptions | NA | To apply the SELinux context to the container. If this parameter is not specified, the container runtime allocates a random SELinux context for each container.
|
seccompProfile | NA | To specify the seccomp options used by the container. If seccomp options are specified at both the pod and container level, the container options override the pod options.
|
windowsOptions | NA | To specify Windows-specific options for every container.
|