26 Jun 2020 07:46 PM - last edited on 11 Dec 2024 08:47 AM by MaciejNeumann
Hello,
I am trying to clean up the URLs for services in Dynatrace so they become a single "request", for example:
/v2/profiles/users/2618505/offices/454474/preferences
To become something like:
/v2/profiles/users/<userid>/offices/<officeid>/preferences
What I get is thousands of different requests in a service given the different combination of user and office IDs.
The users/<userid> and offices/<officeid> convention is used across multiple different applications in different locations in the URL path, for example in this other application:
/v1/core/users/2623478
/v1/core/offices/9023/service-plans
I could use something like a regex for the preceding word (users/offices) and digits to easily find the occurrences across the board, but I can't seem to find this functionality anywhere. I tried looking into the Generate clean URLs feature which seems appropriate to my needs, but it doesn't seem to have a replace functionality.
Is there a way to accomplish this general replacement on URLs so requests appear generalized in each service?
Thank you
26 Jun 2020 08:12 PM
Hi Gustavo,
Try a web request naming rule for this service.
Maybe a regex like this -> /v2/profiles/users/\d+?/offices/\d+?/preferences
Set up would look like this:-
Let me know if that works.
Thanks,
Ari
26 Jun 2020 08:26 PM
Hi Ari
This will definitely work for this specific endpoint, however I have dozens of endpoints across multiple applications that will use known patterns such as offices/<officeid> and users/<userid> (and others). It's not reasonable for me to create individual request naming rules for each endpoint, nor it's future-proof as new applications are developed using the same request path conventions.
Therefore I am looking for a way to do this across the board, or at the very least, for all requests in a given application. Definitely not for every individual endpoint.
Pretty similar to how Dynatrace handles UUIDs, as it's able to replace all of them with a /path/to/[UUID]/more/stuff name for the requests with UUIDs.
Thanks
26 Jun 2020 08:34 PM
Ahh okay, I see what you mean.
You can create a global request naming rule using the API. Have you looked into that option as a potential solution?
Thanks,
Ari
26 Jun 2020 08:58 PM
I did look at the request naming capabilities (both global and per service), and they are not suitable. Global request naming rules are pretty much the same as the example you provided, the difference is they would work across the board, but I'd still need to define a new rule for every single endpoint.
Given the screenshot on the old forum post, it feels like this functionality used to exist, at least on a per-service basis, but was nixed for unknown reasons.