Splunk AppDynamics Application Name Strategies
The Controller's Application Dashboard provides three application name strategies. Select a strategy by assigning the appNameStrategy
property to one of these values:
manual: Use the
defaultAppName
orappName
parameters in thecluster-agent.yaml
file to set the application name.label: Use a label from the workload's spec as the application name.
namespace: Use the Kubernetes namespace as the application name.
Manual Strategy
By default, the appNameStrategy
is manual
, which uses the defaultAppName
or appName
parameter to set the application name.
- If
defaultAppName
is provided, then use it (unless overwritten in an instrumentation rule). - If
appName
is provided in an instrumentation rule, then use it.
For example in this spec, ECommerce
is the default application name applied to the ecom
and groceries
namespace, and BookStore
is the application name applied to the books
namespace.
apiVersion: cluster.appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
name: k8s-cluster-agent
namespace: appdynamics
spec:
appName: "<cluster-name>"
# ...
# auto-instrumentation config
instrumentationMethod: Env
nsToInstrumentRegex: ecom|books|groceries
appNameStrategy: manual
defaultAppName: ECommerce
instrumentationRules:
- namespaceRegex: books
appName: BookStore
Label Strategy
This option uses the label
parameter as the application name strategy. To use the label option, specify a value in the appNameLabel
parameter. The appNameLabel
value refers to a label specified in the workload spec.
- If
spec.appNameLabel
is specified, then spec level value is used. - If
appNameLabel
is specified in an instrumentation rule, then that value is used unless a different appNameLabel is specified in the spec. - If the appNameLabel mentioned in the instrumentation rule is not found in the deployment spec, then the spec level
appNameLabel
value is used.
In the following example spec, appNameLabel: app
is used in the instrumentation rule, but the deployment spec does not have the label app
. The spec has a label called appname
which has a value eCommerce
.Therefore, Controller displays the data that is reporting to eCommerce
application.
In the following spec, the workload spec label appname
is used to set the application name in the ecom
and groceries
namespaces, and the label app
is used in the books
namespace.
apiVersion: cluster.appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
name: k8s-cluster-agent
namespace: appdynamics
spec:
appName: "<cluster-name>"
# ...
# auto-instrumentation config
instrumentationMethod: Env
nsToInstrumentRegex: ecom|books|groceries
appNameStrategy: label
appNameLabel: appname
instrumentationRules:
- namespaceRegex: books
appNameLabel: app
For an application deployed to the ecom or groceries namespaces that sets the label appname (shown in this Deployment spec snippet), it reports to the eCommerce application in the Controller's Application Dashboard.
apiVersion: apps/v1
kind: Deployment
metadata:
name: ecom-app
labels:
appname: eCommerce
spec:
...
Namespace Strategy
This option uses the Kubernetes namespace
parameter as the application name strategy and allows you to use the namespace name where an application is deployed as the application name in the Controller's Application Dashboard.
In this spec, each application in ecom
, books
, and groceries
namespace uses the application name based on the namespace that it is deployed to.
apiVersion: cluster.appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
name: k8s-cluster-agent
namespace: appdynamics
spec:
appName: "<cluster-name>"
# ...
# auto-instrumentation config
instrumentationMethod: Env
nsToInstrumentRegex: ecom|books|groceries
appNameStrategy: namespace