<?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 - Global request naming for REST services in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/186509#M405</link>
    <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/23195"&gt;@Malaik&lt;/a&gt;&amp;nbsp;the placeholders&amp;nbsp;&lt;SPAN&gt;{prefix}, {infix}, and {postfix} are extracted from the URL with regular expressions. See the placeholders section of the rule.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 14 May 2022 21:28:13 GMT</pubDate>
    <dc:creator>Julius_Loman</dc:creator>
    <dc:date>2022-05-14T21:28:13Z</dc:date>
    <item>
      <title>PRO TIP - Global request naming for REST services</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/176341#M289</link>
      <description>&lt;P&gt;Dynatrace does a pretty good job at request naming for common frameworks. Unfortunately, for some generic REST services, it may require request naming rules or URL cleanup rules, so requests are properly identified.&lt;BR /&gt;&lt;BR /&gt;For example if your requests have names in Dynatrace such as:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/api/v1/client/123/data&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/customers/812345/shopping-cart&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;instead of&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/api/v1/client/[ID]/data&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/customers/[ID]/shopping-cart&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;then you probably know you need to use the request naming rules. The request naming rules can be defined at a particular service. However, if you have many different request URL patterns, it's not efficient to define a rule for each one. There are even more challenges if you need to define such patterns on many services across multiple Dynatrace environments.&lt;BR /&gt;&lt;BR /&gt;In such cases, it's worth considering&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/service-api/request-naming-api/" target="_self"&gt;Request naming rules API&lt;/A&gt;&amp;nbsp;and defining a pattern to remove the numbers in requests names.&lt;BR /&gt;&lt;BR /&gt;For the example from above to remove a number from an URL, we need to extract the prefix and postfix. Let's use regular expressions for that:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Prefix extraction pattern&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;^(.*?/)\d+&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Postfix extraction pattern&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;/\d++(/[^/]*+)$&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Condition pattern&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;\&lt;/SPAN&gt;&lt;SPAN&gt;d++&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;So our rule will be applied only if the Request URL matches the condition - a forward slash followed by a sequence of numbers.&amp;nbsp;Additionally, we want to define a scope&amp;nbsp;for this rule to apply. This can be accomplished for example by using tags or management zones in the conditions as well as other conditions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In our case, the request naming rule payload for the API will look like the example below and it will be applied to a set of services tagged by the tag "REST Cleanup". Since this is a JSON payload, the regex patterns must be correctly escaped:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
 "conditions": [
  {
   "attribute": "WEBREQUEST_URL_PATH",
   "comparisonInfo": {
    "caseSensitive": false,
    "comparison": "REGEX_MATCHES",
    "negate": false,
    "type": "STRING",
    "value": "/\\d++",
    "values": null
   }
  },
  {
   "attribute": "SERVICE_TAG",
   "comparisonInfo": {
    "comparison": "TAG_KEY_EQUALS",
    "negate": false,
    "type": "TAG",
    "value": {
     "context": "CONTEXTLESS",
     "key": "REST Cleanup"
    },
    "values": null
   }
  }
 ],
 "enabled": true,
 "order": "REST 10",
 "managementZones": [],
 "metadata": {
  "clusterVersion": "1.220.96.20210701-171424",
  "configurationVersions": [
   0
  ]
 },
 "namingPattern": "{prefix}[ID]{postfix}",
 "placeholders": [
  {
   "aggregation": null,
   "attribute": "WEBREQUEST_URL_PATH",   
   "delimiterOrRegex": "^(.*?/)\\d+",
   "endDelimiter": null,
   "kind": "REGEX_EXTRACTION",
   "name": "prefix",
   "normalization": "ORIGINAL",
   "requestAttribute": null,
   "source": null,
   "useFromChildCalls": false
  },
  {
   "aggregation": null,
   "attribute": "WEBREQUEST_URL_PATH",
   "delimiterOrRegex": "\/\\d++(\/[^\/]*+)$",
   "endDelimiter": null,
   "kind": "REGEX_EXTRACTION",
   "name": "postfix",
   "normalization": "ORIGINAL",
   "requestAttribute": null,
   "source": null,
   "useFromChildCalls": false
  }
 ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;After this rule is applied using the&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/service-api/request-naming-api/" target="_self"&gt;Request naming rules API&lt;/A&gt;&amp;nbsp;you can see it also on your service in the Request naming settings section :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julius_Loman_0-1637687498721.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/3502iAC1E2485D6E2FA67/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julius_Loman_0-1637687498721.png" alt="Julius_Loman_0-1637687498721.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Now any future request for this service will have the desired naming with numbers removed.&lt;BR /&gt;&lt;BR /&gt;If you have REST requests which have two numbers similarly you will need also another rule preceding the rule above and extracting prefix, infix and postfix parts of the URL and then constructing a new request name:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
 "conditions": [
  {
   "attribute": "WEBREQUEST_URL_PATH",
   "comparisonInfo": {
    "caseSensitive": false,
    "comparison": "REGEX_MATCHES",
    "negate": false,
    "type": "STRING",
    "value": "\/\\d++\/[\/\\D-]*+\\d++",
    "values": null
   }
  },
  {
   "attribute": "SERVICE_TAG",
   "comparisonInfo": {
    "comparison": "TAG_KEY_EQUALS",
    "negate": false,
    "type": "TAG",
    "value": {
     "context": "CONTEXTLESS",
     "key": "REST Cleanup"
    },
    "values": null
   }
  }
 ],
 "enabled": true,
 "order": "REST 00",
 "managementZones": [],
 "metadata": {
  "clusterVersion": "1.220.96.20210701-171424",
  "configurationVersions": [
   0
  ]
 },
 "namingPattern": "{prefix}[ID]{infix}[ID]{postfix}",
 "placeholders": [
  {
   "aggregation": null,
   "attribute": "WEBREQUEST_URL_PATH",   
   "delimiterOrRegex": "^(.*?/)\\d+",
   "endDelimiter": null,
   "kind": "REGEX_EXTRACTION",
   "name": "prefix",
   "normalization": "ORIGINAL",
   "requestAttribute": null,
   "source": null,
   "useFromChildCalls": false
  },
  {
    "aggregation": null,
    "attribute": "WEBREQUEST_URL_PATH",   
    "delimiterOrRegex": "\/\\d++(\/[\/\\D-]*+)\\d++",
    "endDelimiter": null,
    "kind": "REGEX_EXTRACTION",
    "name": "infix",
    "normalization": "ORIGINAL",
    "requestAttribute": null,
    "source": null,
    "useFromChildCalls": false
   },
   {
   "aggregation": null,
   "attribute": "WEBREQUEST_URL_PATH",
   "delimiterOrRegex": "\/\\d++(\/[^\/]*+)$",
   "endDelimiter": null,
   "kind": "REGEX_EXTRACTION",
   "name": "postfix",
   "normalization": "ORIGINAL",
   "requestAttribute": null,
   "source": null,
   "useFromChildCalls": false
  }
 ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;To make it more simple to deploy, you can use the attached &lt;A href="https://github.com/dynatrace-oss/dynatrace-monitoring-as-code" target="_self"&gt;monaco&lt;/A&gt; project which makes those rules easily deployable.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 07:50:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/176341#M289</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2022-12-15T07:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP - Global request naming for REST services</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/186504#M404</link>
      <description>&lt;P&gt;Thanks so much&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;{prefix}, {infix}, and {postfix} should be replaced by the values from the table or we can declare them as a variables somewhere?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a good day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 01:11:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/186504#M404</guid>
      <dc:creator>Malaik</dc:creator>
      <dc:date>2022-05-14T01:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP - Global request naming for REST services</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/186509#M405</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/23195"&gt;@Malaik&lt;/a&gt;&amp;nbsp;the placeholders&amp;nbsp;&lt;SPAN&gt;{prefix}, {infix}, and {postfix} are extracted from the URL with regular expressions. See the placeholders section of the rule.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 21:28:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/186509#M405</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2022-05-14T21:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP - Global request naming for REST services</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/186599#M406</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;right, my question was gone too quickly.&lt;/P&gt;&lt;P&gt;Have a good day.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 09:35:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/186599#M406</guid>
      <dc:creator>Malaik</dc:creator>
      <dc:date>2022-05-17T09:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP - Global request naming for REST services</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/232602#M1130</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you for sharing this, &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It's an almost constant need for all build projects. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It's really unfortunate that the overall management of placeholders and request naming rules is still not available at the interface level (your article dates back to 2021!). It would be so much better for the client adoption by non-technical people.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thx.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 15:41:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/232602#M1130</guid>
      <dc:creator>AurelienGravier</dc:creator>
      <dc:date>2023-12-21T15:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP - Global request naming for REST services</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/237047#M1156</link>
      <description>&lt;P&gt;Great Tip!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 21:43:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/237047#M1156</guid>
      <dc:creator>MostafaHussein</dc:creator>
      <dc:date>2024-02-13T21:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP - Global request naming for REST services</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/272430#M1595</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;I've discovered the same issue where it would be great if the Clean URL rule would let you specify the replacement text instead of just deleting the values.&amp;nbsp; The example I'm trying to solve is a bit more complex and I'm running into dynatrace not allowing quantified groups in the regex here.&lt;/P&gt;&lt;P&gt;Example Request Names:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/api/clients/[UUID]/plans/d9be25d0-1a9c-4970-985f-59102adf6884+796edda1-2292-4228-912c-6ea66ca6c573/projection/subroute1/subroute2
/api/clients/[UUID]/plans/d9be25d0-1a9c-4970-985f-59102adf6884+796edda1-2292-4228-912c-6ea66ca6c573+d9be25d0-1a9c-4970-985f-59102adf6884+796edda1-2292-4228-912c-6ea66ca6c573/projection/subroute1/subroute2/subroute3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;So dynatrace has already seen that our client id is a guid and replaced it correctly, but another id in the path is actually 1 or more UUIDs together, joined with + if there is more than one.&amp;nbsp; If there is only 1 it correctly matches and replaces it with [UUID] but when there are multiple, it does not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basic GUID Regex:&amp;nbsp;[0-9A-Fa-f]{8}-?([0-9A-Fa-f]{4}-?){3}[0-9A-Fa-f]{12}&lt;/P&gt;&lt;P&gt;Multi GUID ID Match Regex: ([0-9A-Fa-f]{8}-?([0-9A-Fa-f]{4}-?){3}[0-9A-Fa-f]{12}\+?)++&lt;/P&gt;&lt;P&gt;OR A more explicit version since a single GUID plan id will already be correctly replaced:&amp;nbsp;([0-9A-Fa-f]{8}-?([0-9A-Fa-f]{4}-?){3}[0-9A-Fa-f]{12}\+)++[0-9A-Fa-f]{8}-?([0-9A-Fa-f]{4}-?){3}[0-9A-Fa-f]{12}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm struggling to apply your prefix and postfix methods to this more complex example in a way that dynatrace will accept. Primarily that it says Quantified groups are not allowed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any guidance you can give would be great&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 17:25:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Global-request-naming-for-REST-services/m-p/272430#M1595</guid>
      <dc:creator>WillGunn_e</dc:creator>
      <dc:date>2025-03-13T17:25:31Z</dc:date>
    </item>
  </channel>
</rss>

