<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pro Tip - Tagging entities which have no autotagging rule support with relationships in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/185059#M380</link>
    <description>&lt;P&gt;This is golden!&amp;nbsp; Thanks for putting this together.&amp;nbsp; Helped me a whole lot on learning how to do this tagging this morning.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 12:44:47 GMT</pubDate>
    <dc:creator>Kenny_Gillette</dc:creator>
    <dc:date>2022-04-19T12:44:47Z</dc:date>
    <item>
      <title>Pro Tip - Tagging entities which have no autotagging rule support with relationships</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/175701#M278</link>
      <description>&lt;P&gt;When creating Dynatrace autotags via the UI supported rules you might miss a few entities you'd like to tag. For example there is no easy way to tag a Kubernetes Cluster or a Container Instance.&lt;/P&gt;
&lt;P&gt;You might need that though for API analysis or other usecases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution I use to tag the complete stack (K8s cluster, hosts, processes, services, applications, synthetic monitors) for everything that runs/is provided by a specific kubernetes cluster is the following:&lt;/P&gt;
&lt;P&gt;(entity Selectors and relationship mapping to the rescue).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Identify and tag the kubernetes cluster&lt;/LI&gt;
&lt;LI&gt;Tag all hosts of this cluster, using the toRelationship.isClusterOfHost&lt;/LI&gt;
&lt;LI&gt;Tag all cloud application of this cluster, using the toRelationships.isClusterOfCa&lt;/LI&gt;
&lt;LI&gt;Tag all process groups of the tagged cloud application, using the fromRelationships.isPgOfCa&lt;/LI&gt;
&lt;LI&gt;Tag all process group instances of the tagged process groups, using the fromRelationships.isInstanceOf&lt;/LI&gt;
&lt;LI&gt;Tag all services that are provided by the tagged process groups, using the fromRelationships.runsOn&lt;/LI&gt;
&lt;LI&gt;Tag all applications that are calling the tagged service, using the&amp;nbsp;fromRelationships.calls&lt;/LI&gt;
&lt;LI&gt;tag all synthetic monitors that are monitoring the tagged applications, using the&amp;nbsp;fromRelationships.monitors&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;A concrete example (I'm using YAML notation for the JSON formated auto-tag rule used by the DT API):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  name: dev-stage
  description:
  entitySelectorBasedRules:
  - enabled: true
    entitySelector: type(KUBERNETES_CLUSTER),entityName(_dev)
    valueFormat: ''
  - enabled: true
    entitySelector: type(HOST),toRelationships.isClusterOfHost(type(KUBERNETES_CLUSTER),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(CLOUD_APPLICATION_NAMESPACE),toRelationships.isClusterOfNamespace(type(KUBERNETES_CLUSTER),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(CLOUD_APPLICATION),toRelationships.isClusterOfCa(type(KUBERNETES_CLUSTER),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(PROCESS_GROUP),fromRelationships.isPgOfCa(type(CLOUD_APPLICATION),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(PROCESS_GROUP_INSTANCE),fromRelationships.isInstanceOf(type(PROCESS_GROUP),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(CONTAINER_GROUP_INSTANCE),fromRelationships.isCgiOfCluster(type(KUBERNETES_CLUSTER),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(SERVICE),fromRelationships.runsOn(type(PROCESS_GROUP),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(APPLICATION),fromRelationships.calls(type(SERVICE),tag(dev-stage))
    valueFormat: ''
  - enabled: true
    entitySelector: type(SYNTHETIC_TEST),fromRelationships.monitors(type(APPLICATION),tag(dev-stage))
    valueFormat: ''
  rules: []&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At first this seems counter intuitive as the first rule would ONLY tag the Kubernetes cluster and the other rules would not do anything (because of the entitySelector filter tag(dev-stage) - which is a reference to the tag we are just defining).&lt;BR /&gt;But once the first rule is applied to the K8s cluster all the other rules start to 'unfold': the HOSTs are tagged with the same tag, the CLOUD_APPLICATIONS.&lt;BR /&gt;Once the CLOUD_APPLICATIONS are tagged the depending PROCESS_GROUPS are also tagged and so on.&lt;BR /&gt;The CONTAINER_GROUP instances are tagged as well (you cannot directly select them in non-entity selector based rules).&lt;BR /&gt;&lt;BR /&gt;This ruleset basically triggers a chain-reaction of applying the same tag across the different dependencies that Dynatrace detected on the fly. Which dependencies you want to consider for this is up to you (whatever you can find in the from/to relationships of an entity is possible).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where would you like to use this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;This is fantastic for "dynamic" and simplified management zone assignment&lt;/LI&gt;
&lt;LI&gt;It is also great in combination with custom metric charts (also using entity selectors) for metrics on entities that you cannot tag otherwise (e.g. container instance metrics)&lt;/LI&gt;
&lt;LI&gt;It's also perfect for tagging entities that do not yet exist or create a dependency at some point.&lt;BR /&gt;(e.g. a service that suddenly calls a already tagged service would be tagged and thus shows up on your dashboard that has a tagging filter)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thought I share this tagging strategy &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;kr,&lt;/P&gt;
&lt;P&gt;Reinhard&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 11:16:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/175701#M278</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2021-11-18T11:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pro Tip - Tagging entities which have no autotagging rule support with relationships</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/175763#M279</link>
      <description>&lt;P&gt;Thank you, Reinhard! That's a really comprehensive tip article &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I hope many other Dynatrace users will find it super useful&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@F53D25849628E5B940F6413454FC1A08/images/emoticons/dynatrace.png" alt=":dynatrace:" title=":dynatrace:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 09:30:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/175763#M279</guid>
      <dc:creator>Karolina_Linda</dc:creator>
      <dc:date>2021-11-12T09:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pro Tip - Tagging entities which have no autotagging rule support with relationships</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/175773#M282</link>
      <description>&lt;P&gt;This is super useful and indeed Protip. I'd love to use this in our customer places. Thanks for sharing, Reinhard.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 11:53:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/175773#M282</guid>
      <dc:creator>theharithsa</dc:creator>
      <dc:date>2021-11-12T11:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Pro Tip - Tagging entities which have no autotagging rule support with relationships</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/185059#M380</link>
      <description>&lt;P&gt;This is golden!&amp;nbsp; Thanks for putting this together.&amp;nbsp; Helped me a whole lot on learning how to do this tagging this morning.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:44:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-Tagging-entities-which-have-no-autotagging-rule-support/m-p/185059#M380</guid>
      <dc:creator>Kenny_Gillette</dc:creator>
      <dc:date>2022-04-19T12:44:47Z</dc:date>
    </item>
  </channel>
</rss>

