How can I, via API, tell Dynatrace to not use the Web Server Name in the service detection (only use the context-path and the Web application ID) to merge all the default detected services in one service?
This is a perfect use case for the service detection API.
With the API you can create a rule that will modify the detected service properties (Web Application ID / Context Root or Web Server Name) and you can specify the scope of the rule.
The modifications are either an override with a static value or some sort of extraction / modification of the detected value. You cannot push an extracted value from one property to another - for example use part of application id for context root.
First I recommend to read two blog posts regarding this feature by @Michael K.:
See the following simple example in one of our customer’s cases - this example sets the server name to the values up to first character “m” for each web request service where the server name starts with xxx01. Other service properties - Context Root and Application ID are left untouched in this example. I believe this is almost exactly your case.
There are several properties you can use. Without exactly knowing your environment and how your services have been automatically detected, it is difficult to suggest a rule.
Please see the docs for all options:
I agree this is complex, the docs are lacking some details such as all possible attributes for operations. And more examples will be definitely appreciated by the community :-).
I believe in your case you will probably want to just override the server name value. So it will likely look like this. You may want to add some additional conditions for the scope of this rule :
thanks for your response!!! one more question, If we’ve one rule like this and we monitor other zuul processes, the serverName for these new monitored processes will be ZUUL server and these newservices will be merged with the existing ones, rigth?
So, with this approach the maintenance will be lower.
for the full web request, the services will be merged only within a process group. So if you have your process groups correctly, the rule will apply automatically. So if the processes have different process groups, the services will not merge. If the newly added server falls into the same process group, the service will be automatically merged.
This is exactly why I prefer these rules over existing merge service functionality which is static. Typically you don’t have to worry about any maintenance when scaling your applications.