14 Oct 2024
11:25 AM
- last edited on
16 Oct 2024
07:08 AM
by
MaciejNeumann
Hello,
I want to create Endpoints Rules ( Request Naming Rules) for a particular service (not global) via API.
I made it in UI, but we would like to create rules automatically, so that later we can make graphs in dashboards and watch response time are splitted by Endpoints.
I figured out how to create KeyRegister Names via API, but I can't find how to make the Rules themselves.
I also think I found where is Global rules via api/config/v1/service/requestNaming, but we don't have access to it.
I read that you can't create rules for a specific service via API, but it's very strange that you can create a KeyRegister Names for particular service, but not Rules.
If anyone has any thoughts on this, please share.
Solved! Go to Solution.
14 Oct 2024 12:41 PM - edited 14 Oct 2024 12:43 PM
Hello @Bro-VV,
to achieve what you want you should use extra conditions. For example you can assign naming rule to service by TAG:
{
"enabled": true,
"namingPattern": "PATTERN",
"managementZones": [],
"conditions": [
{
"attribute": "SERVICE_TAG",
"comparisonInfo": {
"type": "TAG",
"comparison": "EQUALS_ANY_OF",
"value": null,
"values": [
{
"context": "CONTEXTLESS",
"key": "KEY",
"value": "YOUR_TAG"
}
],
"negate": false
}
}
],
"placeholders": [
]
}
Full list what attribute is possible to use is here:
Request naming API - POST a new request naming rule - Dynatrace Docs
Best Reagrds
Michał
14 Oct 2024 03:10 PM
Thank you @michal_lewi
Unfortunately, I have no access to api/config/v1/, I hope that I can do it via something like api/v2/settings/, like KeyRequestNames...
02 Jan 2025 03:51 PM
Hi, @Bro-VV! Have you managed to find the answer to your question? It would be great if you share it with the Community 🙂
06 Jan 2025 10:40 PM
Unfortunately, it's not possible to create or modify request naming rules for particular entities. You can use Global request naming rules and apply them to services based on tags or other filtering as @michal_lewi suggests. If you don't have access to the Configuration API, you must reach out to admin of your Dynatrace environment to provide you with a token with the required scope. A reminder - global rules are global and thus may affect the whole environment.