Can I organize services, process groups, & hosts with tags?

Tags simplify searches for related services, process groups, and hosts in your environment. They also facilitate the collection of related metrics into meaningful groups for analysis. Tags can also be used to develop custom dashboard charts for your server-side services, process groups, or hosts and to assign responsibility to specific team members or groups.

To support tagging, Dynatrace provides both a manual approach (Settings > Tags > Manually applied tags) and an automated, rule-based approach (Settings > Tags > Automatically applied tags).

Manual approach

Dynatrace offers two ways to manually attach a tag to an entity. The first way is to select the respective option from the navigation menu:

  1. Go to Settings > Tags > Manually applied tags.
  2. Type in a tag in the text box.
  3. Click Add. Your tag will be alphabetically inserted in the list below.
  4. Select your newly created tag to manually apply it to the desired entities.
  5. From the listed entities eligible for tagging, select the entities you want to apply your tag to by clicking the respective tick box on the right. You can filter the entities appearing in the list by their type (e.g. service, process, etc. ) or based on whether they are tagged. You can also use the search mechanism to search for a specific entity.
  6. When you are finished, click Done.

Alternatively, you can manually attach a tag to an entity through its overview page.

  1. Go to the overview page of the entity by selecting the corresponding entity category (e.g. Transactions & services) from the navigation menu and selecting the entity you want to tag.
  2. Expand the Properties and tags.
  3. Click Add tag.
  4. Type in a tag for this entity.
  5. Click Add.

Automated approach

In dynamic or large environments, manual tagging can be impractical. In such cases, it’s recommended that you use automated, rule-based tagging. Automatically applied tags behave just like the manually-applied, except they’re applied automatically to new entities that match defined rules. Automatically applied tags can’t be removed manually from individual services, process groups, or hosts. Automatically applied tags are removed automatically once an entity no longer matches a defined rule.

Note: You can also set up automated tagging of the entities in your environment using the Smartscape and topology API.

How to define an automatically applied tag

To define an automatically applied tag:

  1. Go to Settings > Tags > Automatically applied tags.

  2. Type a name for the new tag in the Add new custom tag field and click the Add button to add your new tag. The newly created tag then appears in the list below.

  3. Select the newly defined tag to define rules for the tag.

  4. Click Add new rule.

  5. From the first list box, choose whether you want to apply the rule to a service, a process group, or a host.

  6. Optionally restrict the rule to a specific process group, technology, or service type using the respective drop lists (see image below).

  7. You can add one or more conditions to the rule that the entity (i.e., service, process group, or host) must meet before the tag is applied by clicking Add condition. Conditions check for specific values of any property that is available within the Conditions drop list on the left.
    For example, a condition for a service can be based on the Web application ID. Select equals from the drop list and type the specific ID in the text field. To find the correct Web application ID or other property of a service, go to the service's page by selecting Transactions & services from the navigation menu. Select the service you want and expand the Properties and tags section (see below).

  8. You can also propagate a rule to the underlying entities (i.e., process groups and hosts in case of services) by selecting the corresponding check boxes at the bottom of the rule.

  9. Click the Preview button to verify the results returned by the specific rule. Note that to be tagged, an entity must meet all the specified conditions of a rule.

  10. Click Save to save the rule. You can define multiple rules for each tag. Rules are executed in order. You can change the order in which rules are applied by clicking the Move up/down arrows. You can edit or delete a defined rule or activate/deactivate a rule at any time via the Off/On switch.

  11. To save your tag, click Done at the top of the page.

When you select a tag, you can see the rules currently defined for the tag as well as the entities that match all the defined rules in the Matching entities area (an OR relationship exists between rules). Automatically applied tags are applied to all existing and newly detected entities (i.e., services, process groups, or hosts). Note that it can take up to a minute before your new tag is applied. Once a tag is applied to an entity, the tag is listed on that entity's page. For example, with services, each new tag is listed on the service's page within the Properties and tags section (see image above).

Regular expressions

You can create conditions for your automatically applied tags based on regular expressions. In step 7 above, select the property you want from the Conditions drop list on the left. Then select regex matches from the next drop list and type the regular expression in the text field.

Regular expressions are powerful, but they can lead to unexpected results (for example, lazy vs greedy matching) and they can quickly become expensive (for example, catastrophic backtracking and repeated capture groups). For these reasons, we’ve decided to restrict regular expressions in Dynatrace:

  • Quantified groups aren’t allowed.
  • Dynatrace doesn’t allow greedy matches within capture groups. Use lazy or possessive matching instead.
  • Dynatrace allows exactly one capture group in places where you need to extract a value. The logic here is that if the regular expression contains a group, Dynatrace will use it. Otherwise, the full match will be used for extraction.
  • For pure matching cases, Dynatrace doesn’t allow the capture groups. Please use atomic groups instead.
  • Back references aren't allowed.

Note
Automatically applied tags cannot be used in conditions for automated rule-based tagging.

Service and process group properties available for tagging

The service and process group properties available for tagging vary based on technology type.

To find out which properties a service provides:

  1. Select Transactions & services from the navigation menu.
  2. Select the service that you want to tag.
  3. Click Properties and tags to display the available properties.

To find out which properties a process group provides

  1. Select Hosts from the navigation menu.
  2. Select the host that includes the process group you want to tag.
  3. Click Properties and tags to display the available properties.

Properties supported by Dynatrace for automated tagging

Rule examples for defining automatically applied tags

The image below shows two rules. The first rule filters services that are of type Web service, running on Tomcat, that include the string BB in their process group names. The second rule returns services that run on Tomcat and whose Web application ID contains the word frontend.

The rule example below matches all services that are built on Java-based service technologies, run in a Cloud Foundry space called development, have the PaaS setup type cloud foundry, and include the string spring within their detected process group name.

The example below shows a rule that applies a tag to all Azure websites services on process groups where the Detected group name does not begin with IIS app pool ~.

The image below shows a rule that tags specific process groups through the selection of the checkbox—thereby additionally applying the tag to the underlying hosts.

The Host tab includes the hosts to which the tag has been propagated (see image below).

Examples of how to use tags

Service, process group, and host tags can be leveraged in a number of ways. Two examples are detailed below.

Narrow down your analysis

You can use tags to narrow the focus of your analysis to a specific set of services. Go to Transactions & services in the navigation menu. Filter the services based on the criteria listed on the left (State, Service type, and/or other). See example below.

Once you've selected a tagged group of related services, it's easy to focus your analysis on those services. For example, click the Chart button at the top of the Services page to generate tag-specific charts for the selected services (see below).

Newly deployed services that match your tagging rules are automatically tagged and added to your charts. Tag-specific charts can even be pinned to your home dashboard.

Ensure efficient routing of problem notifications

You can also use tags for efficient routing of problem notifications to responsible team members. Go to Settings > Integration > Problem notifications and click Set up notifications. Select the appropriate incident-management system or team-collaboration channel. Then enable the Filter on tags switch at the bottom of the page and assign relevant tags. See the Slack integration example below.

Once set up, the next time a problem notification is sent out, Dynatrace will check to see if any affected services carry properties that you've defined in your service tags. In this way, when critical parts of your environment are affected by a detected problem, the related notification will be delivered to the appropriate teams.

Note

  • OneAgent version 1.111 or higher is required to generate the correct metadata for Cloud Foundry, OpenShift, and Azure Web Sites processes.
  • Usage of the DT_CLUSTER_ID environment ID leads to loss of some metadata within specific processes. This issue has been addressed in OneAgent version 113.