Header background

Dynatrace API can now automate tagging of related components

Tags have long offered a great means of organizing lists, notifications, and charts for related components across all Dynatrace views. Now, with the latest release of the Dynatrace Smartscape and Topology API, you can automate the push of relevant tags to monitored components. This new API feature opens the way for all sorts of powerful automation use cases.

Tags allow you to organize related components into groups for monitoring and tracking purposes. They also facilitate searches for related components and the collection of component metrics into meaningful groups for analysis. Tags are particularly useful when you have a high number of infrastructure components, services, or applications.

Tags can also be used to assign responsible teams and individuals to specific components or to simply group components into team-specific views. In addition to the filtering possibilities that tags provide within list views, you can also use tags to create component-specific dashboard charts.

You have a few options for managing tags within Dynatrace. You can manually tag each of the monitored components in your environment individually. Alternatively, you can bulk tag numerous components simultaneously from the Tagging page (Settings > TaggingManual Tagging).

Use Dynatrace API to manage tags

With the latest release of Dynatrace you now have a new option for managing tags in your environment, using the Dynatrace Smartscape & Topology API. With the Dynatrace API, DevOps teams can automate the creation of tags using custom automation scripts. With just a few lines of scripting, you can automatically create and assign tags to the components in your environment.

Use tags to assign team responsibilities

One valuable use case is to assign user-specific tags to individual components so that individual personnel can easily find and understand their areas of responsibility. This is done by fetching your personnel database and then pushing user-specific tags onto specific infrastructure components, applications, or services.

For example, imagine that an Ops person in your organization is responsible for all Java services within a group of services that has been tagged with PROD. From this point, it’s simple to write a script that fetches all services that have been automatically detected by Dynatrace. The list of services includes all pre-existing tags, enabling you to selectively assign the Ops person responsibility to all services that receive a new tag. The example below shows you how to create such a tag.

This scripting example fetches a list of auto-discovered services along with all tags that have been assigned to the detected services.

Once you push a new responsibility tag onto the service, the script includes the new tag.

Add version tags for artifactories and build infrastructure

For aritfactories and build infrastructure you can write scripts that automatically add version tags to all new service and application deployments. This enables you to generate Dynatrace lists and views that are specific to select release versions.

All newly added tags appear on the associated service pages, as shown below.

Visit the Tagging page (Settings > TaggingManual Tagging) to review the tags that are set up in your environment and the components they are assigned to.

Please refer to Dynatrace API Help for full details on tagging your environment components using the Dynatrace Smartscape & Topology API.  Also, check out this Python example on our Github page to see how you can automatically tag all components using name patterns.