Support for getting parameterized URLs without url_groups

APM Server version:
7.6.0
APM Agent language and version:
Java - 1.17.0

Original install method (e.g. download page, yum, deb, from source, etc.) and version:
Download page

Fresh install or upgraded from other version?
Upgraded version

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.
No

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
We have a path parameterized API implemented in our Springboot application:

Example calls to this API are like:

/owners/3/edit
/owners/4/edit

We would like to group all these transactions based on the API mapping defined. For the above-mentioned example, we would like to group the APIs by /owners/{ownerId}

Currently, in Java we can do it by providing a wildcard expression in the url_groups property.
But for Python3.x agent and Nodejs agent the urls automatically get converted in the parameterized urls format.

Is there a way, we can convert the urls in this format without using the url_groups property?
If not, can you please suggest some approach which can be used to achieve the above for java agent by making some changes in the source code?

Hi and thanks for the question.

We have such support for JAX-RS, which you probably don't use, but you can look at the related code to get a sense of how you can add a generic framework support through an instrumentation plugin.

Otherwise, you can adjust the code that relies on the url_groups setting as you please.

And if you really feel bold, I played some time ago with a learning algorithm that analyses URLs as they arrive to find dynamic parts and substitute them. If you already try to play with our source code, you may try and incorporate that, see if it works for you.

I hope this helps.

As noted by @Eyal_Koren , we have some plugins for which we capture the URL patterns from the underlying framework (Spring MVC, JAX-RS, ...).

If you don't use such high-level framework and rely on a rather low-level API like Servlets, the agent can't do that automatically.

Then you could also use the Agent public API to customize your application transaction names, for example with Servlets you could use something like in this example.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.