I wanted to provide some feedback/discussion on the excellent blog post by @Florent Duchateau
At SAP C4 I faced the similar situation of (automatically) organizing over 12 hosts and close to 100k services in a optimized fashion, mostly for easy downstream processing of alerts and data export to other systems. Manual tagging (or even tagging via an API) is certainly not something we wanted to do.
I like Florent's idea of using hostgroups with regular expressions and then use that information to apply tags so services and processes. We took a different approach though. Mainly because host groups are fixed upon agent installation and cannot be changed on the fly!
I've decided to use custom host properties (by providing/generating a hostcustomproperties.conf) and also hostautotags.conf. As Florent also mentioned this is great if you can do it via a provisioning and configmanagement solution.
Well in our case this is done e.g. via puppet that uses certain information and populates these files.
Unfortunately one cannot assign the value of a host tag to another tag (e.g. in a autotagging rule), however with custom properties you can do that! And that saves my rearend!
So I do have the exact same auto-tagging rule in ˜3000 tenants (created via API), and can dynamically update the property (cld-external-id) in the hostcustomproperties.conf at any time.
The oneagent will notice the change and the information is updated in Dynatrace on all entities.
This allows us to e.g. provide individuals or other systems to edit the file without allowing them to mess/reinstall the oneagent.
Of course you can still apply all the nifty regex magic the same way!
Automation is key!
Thanks for the feedback!
You can now change host groups without re-installing BTW. It is a bit heavy though...