Define tags and metadata for hosts

Within dynamic or large environments, manual host tagging can be impractical. For dynamic deployments that include frequently changing host instances and names (for example, AWS or MS Azure), you can use a dedicated configuration file to programmatically apply tags to your hosts. The same is true for additional host properties, i.e. metadata

Edit the host tag configuration file

During OneAgent installation, the installer creates a simple hostautotag.conf configuration file on the monitored host. On Windows, the file is located in %ProgramData%\dynatrace\oneagent\agent\config, and on Linux in /var/lib/dynatrace/oneagent/agent/config. The file should contain a list of strings or key/value pairs that will be reported to the server with every file change. New lines or spaces are used to separate tag values. For example:

TestHost Gdansk role=fallback

The tags defined in this example result in the following host tagging:

The result of tagging a host via hostautotag.conf configuration file

Configuration file-based tags behave similarly to automated, rule-based tags and environment variable-based tags. Configuration file-based tags can't be removed manually from a host. They can only be removed through a hostautotag.conf file change.

Once configured, the tags will be displayed at the top of the Properties and tags section of the host overview page.

Other options for automated tagging

You can also set up automated tagging of the hosts in your environment using:

Edit the host metadata configuration file

The process of configuring properties is very similar to the one for tags, but this time they are configured through the hostcustomproperties.conf that you need to create and add to OneAgent configuration directories:

  • Windows: %PROGRAMDATA%\dynatrace\oneagent\agent\config
  • all UNIX-like systems /var/lib/dynatrace/oneagent/agent/config

Once configured, custom properties will be displayed at the bottom of the Properties and tags section of the host overview page.

host tags

Any hostautotag.conf or hostcustomproperties.conf files created should be encoded in UTF-8.