自動インストルメンテーションの設定
このページでは、自動インストゥルメンテーションを設定するために使用できる cluster-agent.yaml および Helm の values.yaml ファイルで利用可能なプロパティについて説明します。
Configuration Structure for Auto-Instrumentation
instrumentationConfig.instrumentationVersion parameter to v2 in the cluster-agent.yaml (CLI) or the values.yaml (Helm) file.
- cluster-agent.yaml
-
CODE
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 - values.yaml
-
CODE
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
InstrumentationRules によるデフォルトのプロパティのオーバーライド
クラスタエージェントは、InstrumentationRule 内の namespaceRegex、matchString,、および labelMatch プロパティの組み合わせを使用して、自動インストゥルメンテーションの名前空間内の Deployments、DeploymentConfigs、および StatefulSets をターゲットにします。最初に一致した InstrumentationRule が使用されます。一致するルールが見つからない場合は、デフォルトのプロパティを使用して自動インストルメンテーションを適用するかどうかが決定されます。
nsToInstrumentRegexdefaultInstrumentationLabelMatchdefaultInstrumentMatchString
InstrumentationRule -matchString "<string>" がクラスタエージェント構成ファイルに追加されています。
instrumentationRules:
- matchString: "<string>"
展開名がこの文字列と一致する場合、一致する instrumentationRule にある残りのプロパティが適用され、設定されているデフォルトのプロパティがオーバーライドされます。文字列が一致しない場合、クラスタエージェントはプロパティ nsToInstrumentRegex, defaultInstrumentationLabelMatch および defaultInstrumentMatchString をデフォルト値に設定してインストゥルメンテーション ルールを決定します。
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:
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:
nsToInstrumentnsToInstrumentRegex
- (Optional) To filter and target the set of applications within a namespace that are in scope for auto-instrumentation:
instrumentationMatchStringlabelMatch
- To assign an application and tier name to an instrumented application:
appNameStrategytierNameStrategytierNameSee Application Naming Strategies.
- To instrument which containers are in a multi-container application:
instrumentContainercontainerMatchStringTheinstrumentContainerdefault 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:
analyticsHostanalyticsPortSee 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 host
localhostand port9090and 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 | Default | 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 instrumentationRules configuration. |
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 9090. The default value is applied to all instrumented resources unless it is overwritten by the instrumentationRules configuration. 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 |
|
defaultAppName |
"" | (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 |
|
defaultEnv |
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 Deployment under Validate Auto-Instrumentation. |
|
defaultInstrumentationLabelMatch |
[ ] |
Specific deployment labels marked for instrumentation. This parameter accepts a list of key-value pairs to instrument. You must match a minimum of one label for instrumentation. For example:
For example, if only |
|
defaultInstrumentMatchString |
.* |
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 to update the instrumentation configuration to the successfully instrumented deployments during Cluster Agent upgrade. 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. |
|
imageInfo |
CODE
CODE
CODE
|
The Docker repository from where the Node.js Agent, .NET Core for Linux, and Java Agent is pulled. Supported values are:
This parameter is used in the init containers that are added during auto-instrumentation. |
|
instrumentationMethod |
None |
The instrumentation method used for instrumenting Apps. Supported values are:
|
|
|
v1 | This is required to auto-instrument applications in multiple container environment. You can include a single or multiple application types.
If you specify the value as v2, you can auto-instrument applications in a multi-container pod that uses either a single language with different configuration or multiple languages. However, with v2, the custom agent configurations using the configuration files are unsupported. |
|
instrumentationRules |
[ ] |
Required. This parameter is used to enable auto-instrumentation.This includes the list of specific instrumentation rules. You can apply the rules to one or more namespaces, and can filter on deployment names and labels. Instrumentation rules are granular to support targeting specific deployments. |
|
javaAgentCustomSSLKeystore |
N/A |
Secret name for Java Agent SSL keystrore file. For more information, see Use Custom SSL for Java Agent Auto-Instrumentation. |
|
javaAgentCustomSSLKeystorePasswordSecret |
N/A |
Secret name for Java Agent SSL keystrore password. For more information, see Use Custom SSL for Java Agent Auto-Instrumentation. |
|
nsToInstrumentRegex |
"" |
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.
|
|
netvizInfo |
bciEnabled: true port: 3892 |
To configure the Network Visibility App Agent, netviz, Install Infrastructure Visibility with the Kubernetes CLI on how to install the Network Agent. By default, Supported values are:
|
|
runAsGroup |
0 |
If you configured the application container as a non-root user, provide the group ID (GID) of the corresponding group.
The default |
|
runAsUser |
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 resourcesToInstrument:
|
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
CODEkubectl exec -it <cluster-agent-pod-name> -n <namespace> sh - Navigate to the logs directory.
- Open the
InstallationReport.csvfile 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
custom-ssl.jks. For information about creating certificates, see
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.
CODE
kubectl -n appdynamics create secret generic <secret name> --from-file=<path to custom-ssl.jks file> - Create secret for the keystore password.
CODE
kubectl -n appdynamics create secret generic <secret name> --from-literal=keystore-password=‘<keystorePassword>’
Update Secrets After Certificate Update
If you change the custom SSL keystore file or the keystore password, you require to perform the following:
-
Delete the existing
appd-certand thejava-agent-custom-ssl-passwordsecrets in the application namespace.CODEkubectl -n <application-namespace> delete secret appd-certCODEkubectl -n <application-namespace> delete secret java-agent-custom-ssl-passwordDeleting the stale secrets (
appd-certandjava-agent-custom-ssl-password) in the application namespace is required to avoid stale or conflicting secret data during this update process. - 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 プロパティ
次の表に、InstrumentationRule で自動インストルメンテーションを設定するために使用できるプロパティを示します。
| パラメータ名 | デフォルト値 | 説明 |
|---|---|---|
analyticsHost |
N/A |
分析エージェントのホスト名。 このパラメータは、Node.js エージェントまたは .NET Core エージェントでデフォルトのトランザクションデータを Analytics エージェントに送信する必要がある場合に必須となります。 |
analyticsPort |
N/A |
分析エージェントのリスニングポート。 たとえば、分析エージェントがポート 9090 でリッスンしている場合、このパラメータの値は 9090 です。 このパラメータは、Node.js エージェントでデフォルトのトランザクションデータを分析エージェントに送信する必要がある場合に、defaultAnalyticsHost で必要となります。 |
analyticsSslEnabled |
N/A |
この値は、Analytics エージェントポートが SSL 対応かどうかに基づいています。ポートが SSL 対応でない場合は、値を false と指定します。
|
containerMatchString |
N/A |
これは、値を満たす名前を持つコンテナを選択するための正規表現値です。このパラメータでは、 このパラメータとともに
|
customAgentConfigSource |
N/A |
このパラメータは、ConfigMaps を介してインストゥルメント化するエージェントのカスタム設定を使用するオプションを提供します。このパラメータでは、クラスタエージェントの名前空間に必要な ConfigMap を作成する必要があります。このパラメータは、クラスタエージェントの YAML ファイルから動的に設定できます。YAML ファイルに加えた変更は、アプリケーションを再起動することなく、インストゥルメント化されたすべてのエージェントに対して更新されます。同様に、ConfigMap の設定に加えた変更は、アプリケーションを再起動することなく、すべてのインストゥルメント化されたエージェントに対して更新されます。
注: 展開から ConfigMap ファイル(ルールで使用)を削除する必要がある場合は、最初にこのパラメータをクラスタエージェントの YAML ファイルから削除し、次にクラスタエージェントの名前空間から ConfigMap を削除する必要があります。
|
customSecretName |
N/A |
カスタムシークレット名。これは、ライセンスルールを定義するときに生成される名前と同じです。 |
customSecretKey |
N/A |
カスタムシークレットキー。これは、ライセンス ルールを定義するときに生成されるキーと同じです。 |
|
instrumentContainer |
first |
このパラメータは、インストゥルメント化する必要があるコンテナを選択するオプションを提供します。次の値のいずれでも指定できます。
|
language |
N/A |
インストゥルメント化されるアプリケーションの言語。 サポート対象の言語は次のとおりです。
|
matchString |
N/A |
ルールが適用される展開名を照合するための正規表現。 このパラメータに値を指定しない場合、クラスタエージェントは defaultInstrumentMatchString で指定された値を使用し、その値を満たすすべての展開をインストゥルメント化します。 |
namespaceRegex |
"" |
このルールの一部としてインストゥルメント化される名前空間を指定する正規表現。名前空間は、パイプ記号(|) を使用してスペースを使用せずに区切ることができます。 |
labelMatch |
{} | このルールに含めるラベルの key-value ペアのリスト。 いずれかのラベルと一致すれば満たされます。例:
labelMatch
|
appName |
<defaultAppName> |
コントローラに報告するために Java エージェントによって使用されるアプリケーション名。これは defaultAppName を上書きします。 値が指定されていない場合は、構成された defaultAppName が使用されます。 |
appNameLabel |
N/A |
Splunk AppDynamicsこのラベルの値は、 アプリケーション名になります。 |
customAgentConfig |
N/A |
このパラメータは、Java および Node.js アプリケーションに固有です。 アプリケーション フレームワークでインストルメンテーションに特定の設定が必要な場合は、カスタムシステムプロパティを追加できます。 Java アプリケーションの場合:この値は、他の Java エージェントプロパティとともに設定された または 変数に追加されます。 Node.js アプリケーションの場合:この値は NODE_OPTIONS に追加されます。 |
tierName |
"" |
コントローラに報告するために Java エージェントによって使用される階層名。 階層名が指定されていない場合は、階層の名前戦略が手動のとき、展開名がデフォルトとして使用されます。 |
tierNameLabel |
N/A |
このラベルの値は、AppDynamics 階層名になります。 |
nodeName |
"" | このパラメータは、階層の下のノードに順番に名前を付けるために使用されます。abcたとえば、階層内で使用される 2 つのノードがあり、アプリケーション環境の展開名は とします。構成ファイルでノード名の値を指定しない場合、クラスタエージェントは次をノード名とします。
注: -Dappdynamics.agent.reuse.nodeName.prefix JVM 引数は、自動インストゥルメンテーションではサポートされていません。
|
| reuseNodeName | true |
このパラメータは、 Javaエージェントにのみ適用されます。 ノード名を再利用する必要がない場合は、このプロパティを
注: -Dappdynamics.agent.reuse.nodeName JVM 引数は、自動インストゥルメンテーションではサポートされていません。
|
env |
"" |
このパラメータは、Java アプリケーションに固有です。 アプリケーション エージェントのシステムプロパティが追加される環境変数。指定すると、このインストルメンテーション ルールと一致する展開の defaultEnv を上書きします。 何も指定されていない場合、デフォルトは |
imageInfo |
CODE
CODE
CODE
|
次のプロパティのいずれかを選択できます。
このルールで言及されている特定の言語について、このインストルメンテーション ルールと一致する展開の image-info を上書きします。 デフォルトのクラスタレベルの構成を上書きし、この特定の選択したルールにカスタムのエージェントバージョンを使用する場合は、これを構成する必要があります。 |
|
netvizInfo |
bciEnabled;true ポート:3892 |
ネットワークの可視性アプリケーション エージェントの netviz を設定するには、「Kubernetes CLI を使用したインフラストラクチャの可視性のインストール」を参照して、ネットワークエージェントをインストールします。 デフォルトでは、netviz netviz です。 サポートされる値は以下の通りです:
|
|
runAsGroup |
0 |
アプリケーションコンテナを非ルートユーザとして構成した場合は、対応するグループの これにより、エージェント アーティファクトに適切なファイル権限が設定されます。 この値は、インストゥルメント化されたすべてのリソースに適用されます。 デフォルトのインストゥルメンテーション用に設定されている |
|
runAsUser |
0 |
これにより、エージェント アーティファクトに適切なファイル権限が設定されます。 この値は、インストゥルメント化されたすべてのリソースに適用されます。 デフォルトのインストゥルメンテーション用に設定されている |
allowPrivilegeEscalation |
該当なし |
プロセスが親プロセスよりも多くの権限を取得できるかどうかを制御します。次のコンテナとして実行されている場合、この値は true です。
注:
|
capabilities |
該当なし |
実行中のコンテナの POSIX 機能を追加または削除します。これは、コンテナランタイムにデフォルトの機能セットを使用します。
注:
|
privileged |
いいえ |
ホストでのルートに相当する特権モードでコンテナを実行します。
注:
|
procMount |
DefaultProcMount |
コンテナに使用する proc マウントのタイプ。
注: このパラメータは、現在、Deployment および DeploymentConfig モードで使用できます。
|
readOnlyRootFilesystem |
いいえ |
このコンテナに読み取り専用のルートファイルシステムがあるかどうかを指定します。
注:
|
runAsNonRoot |
いいえ |
コンテナを非ルートユーザーとして実行する必要があるかどうかを指定します。 この値が true の場合、Kubelet は実行時にイメージを検証して、ルートとして実行したときにコンテナの開始が失敗することを確認します。このパラメータが指定されていない場合、または値が false の場合、検証は行われません。
注: このパラメータは、現在、Deployment および DeploymentConfig モードで使用できます。
|
seLinuxOptions |
該当なし |
SELinux コンテキストをコンテナに適用します。このパラメータが指定されていない場合、コンテナランタイムは各コンテナにランダムな SELinux コンテキストを割り当てます。
注:
|
seccompProfile |
該当なし |
コンテナで使用される seccomp オプションを指定します。ポッドレベルとコンテナレベルの両方で seccomp オプションが指定されている場合、コンテナオプションはポッドオプションをオーバーライドします。
注:
|
windowsOptions |
該当なし |
すべてのコンテナに Windows 固有のオプションを指定します。
注: このパラメータは、現在、Deployment および DeploymentConfig モードで使用できます。
|