# Support for getting parameterized URLs without url\_groups

**URL:** <https://discuss.elastic.co/t/support-for-getting-parameterized-urls-without-url-groups/272182>\
**Category:** APM\
**Tags:** java\
**Created:** [May 5, 2021, 12:40pm UTC](https://discuss.elastic.co/t/support-for-getting-parameterized-urls-without-url-groups/272182 "2021-05-05T12:40:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bimanarajesh](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@bimanarajesh](https://discuss.elastic.co/u/bimanarajesh)\
**Post date:** [May 5, 2021, 12:40pm UTC](https://discuss.elastic.co/t/support-for-getting-parameterized-urls-without-url-groups/272182/1 "2021-05-05T12:40:00Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [May 5, 2021, 1:09pm UTC](https://discuss.elastic.co/t/support-for-getting-parameterized-urls-without-url-groups/272182/2 "2021-05-05T13:09:28Z")

</div>

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](https://github.com/elastic/apm-agent-java/blob/a20664231402d34e1749119408fa25320b1d76ce/apm-agent-plugins/apm-jaxrs-plugin/src/main/java/co/elastic/apm/agent/jaxrs/JaxRsTransactionNameInstrumentation.java) to get a sense of how you can add a generic framework support through an instrumentation plugin.

Otherwise, you can adjust the [code](https://github.com/elastic/apm-agent-java/blob/d7de9d2298c71c9dc5bc3ff55001b4a72f40f7fd/apm-agent-plugins/apm-servlet-plugin/src/main/java/co/elastic/apm/agent/servlet/ServletTransactionHelper.java#L181-L191) 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](https://github.com/eyalkoren/warehouse/tree/master/url-pattern-recognition/src/eyal/koren/url/recognition) 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.

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [May 12, 2021, 4:35pm UTC](https://discuss.elastic.co/t/support-for-getting-parameterized-urls-without-url-groups/272182/3 "2021-05-12T16:35:18Z")

</div>

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](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html) to customize your application transaction names, for example with Servlets you could use something like [in this example](https://github.com/elastic/apm-contrib/blob/master/apm-agent-java/frameworks/servlet2/ApmServletFilter.java#L51).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 2, 2021, 12:35pm UTC](https://discuss.elastic.co/t/support-for-getting-parameterized-urls-without-url-groups/272182/4 "2021-06-02T12:35:27Z")

</div>

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