I think this really depends on which service types you have and how they are detected.
Basically you can modify or add the service properties such as context root, application id and server name. The rules will apply on services with a condition.
The approach I would take is to check the service types and their metadata (context root, application id, server name). Then determine the values that need to be changed.
For example - if your server names differ between service instances - you either use transformation rules to extract the right value or use the valueOverride to set a fixed value.
Remember:
- you can use only the original value with transformation rules (you cannot use other metadata)
- you can only merge services of the same type (you can’t merge RMI service and full web request)
Here is, for example, one rule I used recently - the services to be merged differed in the server name (the server name property in the service metadata). So in this example for each full web request service where the server begins with soa this rule sets the server name to the value extracted from the detected server name metadata up to the first occurrence of the character “m”:
{<br> "type": "FULL_WEB_REQUEST",<br> "metadata": {<br> "configurationVersions": [<br> 0<br> ],<br> "clusterVersion": "1.186.78.20200212-151447"<br> },<br> "managementZones": [],<br> "id": "8fd1ae6a-d223-4e67-953d-d99a629cb8ab",<br> "name": "Merge",<br> "description": "Merge Rule\n",<br> "enabled": true,<br> "conditions": [<br> {<br> "attributeType": "SERVER_NAME",<br> "compareOperations": [<br> {<br> "type": "STARTS_WITH",<br> "negate": false,<br> "ignoreCase": true,<br> "values": [<br> "soa"<br> ]<br> }<br> ]<br> }<br> ],<br> "applicationId": null,<br> "contextRoot": null,<br> "serverName": {<br> "transformations": [<br> {<br> "type": "BEFORE",<br> "delimiter": "m"<br> }<br> ],<br> "valueOverride": null<br> }<br>}
Process group tags should work in recent server version, I believe the right format is (I’d add compareKeyOnly attribute to the operation if necessary in your case):
"conditions": [<br> {<br> "attributeType": "PG_TAG",<br> "compareOperations": [<br> {<br> "type": "TAG",<br> "tags": [ {<br> "key": "Component",<br> "value": "xxx"<br> } ]<br> }<br> ]<br> }<br>
The documentation needs significant improvement in the area of compare operations.