Download PDF
Download page Manage Tier Naming Rules .
Manage Tier Naming Rules
You can use the Tier Naming Rule functionality to customize the tier name of any managed Java process. Each tier rule maps to a specific server type. Tier Naming Rules allows you to create Rego policies so that the Agent Installer can discover tier names. To do that, the tier naming format or rule condition must have a valid Rego expression. AppDynamics recommends recreating Rego Policies using Tier Naming Rules. See Rego Policy Language.
For information on the Agent Installer API, see Agent Installer Platform Service API.
Tier Naming Format
Format | Description | Example |
---|---|---|
tier-name-format | The format contains only literals and the tier name appears the same as the format. |
|
tier-<AppServerType>-format | The mix of literals and attributes . The tier name is evaluated after passing the attribute and replaces the value of the attribute. Attributes are defined within the angular bracket <AppServerType> . |
|
| The expression is made inside the ` ` . This does not have an attribute, and there is no change in the expression. |
CODE
Assuming the command line is the value above, the tier name format is |
`<CmdlineArray>[count(<CmdlineArray>) - 1]` | The expression is made inside the ` ` . The attributes are parsed. |
CODE
Assuming the command line is the value above, the tier name format is |
Filter Tier Naming Rules
- Go to the Tier Naming Rules tab.
Click Filter Panel.
- Select how you want to filter out a tier naming rule. Options: Status, Enabled, Disabled.
Select or type the Application Scope.
Select the Application Server Type.
Click Apply.
Format:
POST /customNaming/rules/query
Request Example:
curl --location --request POST 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/query' --header 'Authorization: Bearer {AuthToken}'
--header 'Content-Type: application/json' \
--data-raw
{
"enabled": true,
"appServerTypes": [
"TOMCAT"
],
"applicationNames": [
"EcommerceApplication"
]
}
Response Example:
{
"total": 2,
"customConfigFocusedDtoList": [
{
"id": "56112e75-6308-4d04-b9fa-e336b967bc59",
"ruleName": "TomcatRule1",
"priority": 1,
"version": 1,
"enabled": true,
"appServerTypes": [
"TOMCAT"
],
"applicationNames": [
"EcommerceApplication"
]
},
{
"id": "6b8701db-b7d3-4017-8001-ba9de952cd82",
"ruleName": "TomcatRule2",
"priority": 2,
"version": 1,
"enabled": true,
"appServerTypes": [
"TOMCAT"
],
"applicationNames": [
"EcommerceApplication"
]
}
]
}
Add New Tier Naming Rules
- Go to the Tier Naming Rules tab.
Click + Add New Rule.
Enter the following:
Rule Name
Tier Naming Format: Use any characters, words, and variables to define your naming format.
Application Server Types: Select the application server type that the naming rule will apply to.
Conditions: Select values that match the conditions that will be added to the tier.
All string comparisons are case sensitive.
Application Scope: Only tiers in the selected applications will be evaluated against the conditions.
Click Create rule.
Scenario 1: If an existing tier name (Tier 1) is disabled, and a new tier name (New Tier 1) is discovered by the tier rule, the new tier (New Tier 1) will be disabled by default.
Scenario 2: If an existing tier name (Tier 1) is disabled, and it is modified to an existing tier name (Tier 2), by the change of tier rules the status of the tier name (Tier 2) will be not change.
Format:
POST /customNaming/rules
Request Example:
curl --location --request POST 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules' --header 'Authorization: Bearer {AuthToken}' \
--header 'Content-Type: application/json' \
--data-raw
{
"ruleName": "TomcatRule",
"tierNamingFormat": "tomcat-tier-prod",
"processType": "JAVA",
"appServerTypes": [
"tomcat"
],
"priority": 1,
"ruleConditions": [
{
"keyName": "<cmdlineArray[_]>",
"conditionType": "contains",
"value": "-Dcatalina.home=/staging/apache-tomcat-9.0.6"
}
],
"applicationNames": [
"ALL"
]
}
Response Example:
{
"id": "9a7dfb82-480f-4beb-b72c-a3692b54fdec",
"ruleName": "TomcatRule",
"tierNamingFormat": "tomcat-tier-prod",
"processType": "JAVA",
"version": 1,
"appServerTypes": [
"tomcat"
],
"priority": 1,
"enabled": true,
"ruleConditions": [
{
"keyName": "<cmdlineArray[_]>",
"conditionType": "CONTAINS",
"value": "-Dcatalina.home=/staging/apache-tomcat-9.0.6",
"sequence": 0
}
],
"applicationNames": [
"ALL"
]
}
Obtain Tier Naming Rule Details
Format:
GET /customNaming/rules/{Id}/details
Request Example:
curl --location --request GET 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/0c328c2e-d6ab-4343-bcff-792a77c45413/details' \
--header 'Authorization: Bearer {AuthToken}'
Response Example:
{
"id": "56112e75-6308-4d04-b9fa-e336b967bc59",
"ruleName": "TomcatRule1",
"tierNamingFormat": "tomcat-tier-prod",
"processType": "JAVA",
"version": 1,
"appServerTypes": [
"TOMCAT"
],
"priority": 1,
"enabled": true,
"ruleConditions": [
{
"keyName": "<CmdlineArrya[_]>",
"conditionType": "CONTAINS",
"value": "-Dcatalina.home",
"sequence": 1
},
{
"keyName": "<envVarMap.HOSTNAME>",
"conditionType": "EQUAL",
"value": "localhost",
"sequence": 2
}
],
"applicationNames": [
"EcommerceApplication"
]
}
Edit Tier Naming Rules
- Go to the Tier Naming Rules tab.
Select the Rule Name that you want to edit.
- Click Edit rule.
- Edit the following:
- Tier Naming Format
Application Server Types
Conditions
All string comparisons are case sensitive.
Application Scope
- Click Update rule.
Format:
PUT /customNaming/rules/{Id}
Request Example:
curl --location --request PUT 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/9a7dfb82-480f-4beb-b72c-a3692b54fdec' --header 'Authorization: Bearer {AuthToken}' \
--header 'Content-Type: application/json' \
--data-raw
{
"id": "9a7dfb82-480f-4beb-b72c-a3692b54fdec",
"ruleName": "TomcatRule",
"tierNamingFormat": "tomcat-tier-prod",
"processType": "JAVA",
"version": 1,
"appServerTypes": [
"tomcat"
],
"priority": 1,
"enabled": true,
"ruleConditions": [
{
"keyName": "<cmdlineArray[_]>",
"conditionType": "CONTAINS",
"value": "-Dcatalina.home=/staging/apache-tomcat-9.0.6",
"sequence": 0
},
{
"keyName": "<envVarMap.HOSTNAME>",
"conditionType": "EQUAL",
"value": "localhost",
"sequence": 0
}
],
"applicationNames": [
"ALL"
]
}
Response Example:
{
"id": "9a7dfb82-480f-4beb-b72c-a3692b54fdec",
"ruleName": "TomcatRule",
"tierNamingFormat": "tomcat-tier-prod",
"processType": "JAVA",
"version": 2,
"appServerTypes": [
"tomcat"
],
"priority": 1,
"enabled": true,
"ruleConditions": [
{
"keyName": "<cmdlineArray[_]>",
"conditionType": "CONTAINS",
"value": "-Dcatalina.home=/staging/apache-tomcat-9.0.6",
"sequence": 0
},
{
"keyName": "<envVarMap.HOSTNAME>",
"conditionType": "EQUAL",
"value": "localhost",
"sequence": 0
}
],
"applicationNames": [
"ALL"
]
}
Delete Tier Naming Rules
- Go to the Tier Naming Rules tab.
- Select the Rule Name that you want to delete.
- Click Delete Confirmation.
Format:
DELETE /customNaming/rules/{Id}
Request Example:
curl --location --request DELETE 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/9a7dfb82-480f-4beb-b72c-a3692b54fdec' --header 'Authorization: Bearer {AuthToken}'
Response Example:
No response
Enable Tier Naming Rules
- Go to the Tier Naming Rules tab.
- Select the Rule Name that you want to enable.
Click Enable rule.
Format:
POST /customNaming/rules/{Id}/enable
Request Example:
curl --location --request POST 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/9a7dfb82-480f-4beb-b72c-a3692b54fdec/enable' --header 'Authorization: Bearer {AuthToken}'
Response Example:
No response
Disable Tier Naming Rules
- Go to the Tier Naming Rules tab.
- Select the Rule Name that you want to disable.
- Click Disable rule.
Format:
POST /customNaming/rules/{Id}/disable
Request Example:
curl --location --request POST 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/9a7dfb82-480f-4beb-b72c-a3692b54fdec/disable' --header 'Authorization: Bearer {AuthToken}'
Response Example:
No response
Edit Priorities for Tier Naming Rules
- Go to the Tier Naming Rules tab.
- Click Priority.
- Drag and drop rows to rearrange the tier naming rules priority.
Click Save priority order.
The evaluation of a tier name follows the priority order of the configuration rule defined. If none of the rules match, then the default tier name is set by the Agent Installer.
Format:
PATCH /customNaming/rules/bulk
Request Example:
curl --location --request PATCH 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/bulk' --header 'Authorization: Bearer {AuthToken}'
--header 'Content-Type: application/json' \
--data-raw
{
"total": 1,
"items": [
{
"id": "79962b2d-9afb-40e8-9529-428c5077e702",
"priority": 1,
"version": 1
},
{
"id": "9a7dfb82-480f-4beb-b72c-a3692b54fdec",
"priority": 2,
"version": 1
}
]
}
Response Example:
{
"total": 2,
"items": [
{
"ruleName": "TomcatRule1",
"status": "SUCCESS",
"description": null
},
{
"ruleName": "TomcatRule2",
"status": "SUCCESS",
"description": null
}
]
}
Import Tier Naming Rules
- Go to the Tier Naming Rules tab.
Click Import.
Select the JSON file you want to import.
Click Upload.
Click Done once the file has been successfully uploaded.
Format:
POST /customNaming/templates/import
Request Example:
curl --location --request POST 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/templates/import' --header 'Authorization: Bearer {AuthToken}' --header 'Content-Type: application/json' --form 'file=@"<filePath>"
Response Example:
{
"total": 2,
"items": [
{
"ruleName": "TomcatRule3",
"status": "SUCCESS",
"description": null
},
{
"ruleName": "TomcatRule4",
"status": "SUCCESS",
"description": null
}
]
}
Export Tier Naming Rules
- Go to the Tier Naming Rules tab.
- Click Export.
- Click Allow to download the file to local system.
Format:
POST /customNaming/rules/export
Request Example:
curl --location --request POST 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/rules/export' --header 'Authorization: Bearer {AuthToken}' --header 'Content-Type: application/json'
Response Example:
The response is a file in JSON format
Preview the Status of a Tier Naming Rule
- Go to the Tier Naming Rules tab.
- Click Naming Rules Preview.
Preview the status of each rule: Impacted processes, In progress, and No changes.
- Click Done.
Format:
POST /customNaming/preview
Request Example:
curl --location --request POST 'https://demo.saas.appdynamics.com/zero/v1beta/customNaming/preview' --header 'Authorization: Bearer {AuthToken}'
--header 'Content-Type: application/json' \
--data-raw
{
"applicationNames" : [
"ECommerceApp"
],
"curTierInformation": [
{
"tierName": "tier1",
"ruleName": "rul1e1"
}
],
"expectedTierInformation": [
{
"tierName": "tier1",
"ruleName": "rul1e1"
}
],
"previewStatus" : false
}
Response Example 1:
{
"total": 1,
"items": [
{
"nodeName": "Node1",
"applicationName": "EcommerceApp",
"curTierInformation": {
"tierName": "Tier1",
"ruleName": "Rule1"
},
"expectedTierInformation": {
"tierName": "NewTier1",
"ruleName": "NewRule1"
},
"previewStatus": true,
"previewMessage": "Restart to Apply"
}
]
}
Response Example 2:
{
“total”: 2,
“items”: [
{
“nodeName”: “Node1",
“applicationName”: “EcommerceApp”,
“curTierInformation”: {
“tierName”: “Tier1”,
“ruleName”: “Rule1”
},
“expectedTierInformation”: {
“tierName”: “NewTier1",
“ruleName”: “NewRule1"
},
“previewStatus”: true,
“previewMessage”: “Restart to Apply”
},
{
“nodeName”: “Node2”,
“applicationName”: “EcommerceApp”,
“curTierInformation”: {
“tierName”: “Tier1",
“ruleName”: “Rule1"
},
“previewStatus”: true,
“previewMessage”: “No Change”
}
]
}
Once a configuration changes, you can use the Preview API to identify the affect of an existing tier name, before restarting the Java process. The Preview status is only supported in versions >=22.4. Older versions of the agent display in the Failure status, as not supported.
Default Rules
The table below shows default values for tier naming rules.
AppServerType | Sub Category | Default Name | Example |
---|---|---|---|
tomcat |
| tomcat,<JavaUniquePath> | tomcat,/staging/apache*.* |
| tomee,<JavaUniquePath> |
| |
jboss |
| jboss,standalone,<JavaUniquePath> | jboss,standalone,/staging/jboss*.* |
| jboss,domain,<JBossServerGroupName>,<JavaUniquePath> | jboss,domain,defaultServer,/staging/jboss*.* | |
glassfish |
| glassfish,<GlassfishDomainName>,<GlassfishInstanceName>,<JavaUniquePath> | glassfish,domain1,domain1,/staging/glassfish*.* |
weblogic | weblogic | weblogic,<WeblogicDomainName>,<WeblogicInstanceName>,<JavaUniquePath> | weblogic,domain,weblogic1,/staging/weblogic*.* |
websphere |
| webspherewas,<WebSphereCellName>, <WebSphereServerName>,<JavaUniquePath> | webspherewas,wascell,wasServer,/staging/websphere*.* |
| websphereliberty,<WebSphereLibertyServerName>, <JavaUniquePath> | websphereliberty,liberty,/staging/websphere*.* | |
java |
| java,<JavaMainJar> | java,ECommerceApp.jar |
| java,<JavaMainClass>,<JavaUniquePath> | java,EcommerceApplicaton,/staging/EcommerceApplicaton/** |