# Custom Transaction Naming

**URL:** <https://discuss.elastic.co/t/custom-transaction-naming/211317>\
**Category:** APM\
**Tags:** java\
**Created:** [December 10, 2019, 2:30pm UTC](https://discuss.elastic.co/t/custom-transaction-naming/211317 "2019-12-10T14:30:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joy\_Chatterjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joy_chatterjee/32/59122_2.png) [@Joy\_Chatterjee](https://discuss.elastic.co/u/Joy_Chatterjee)\
**Post date:** [December 10, 2019, 2:30pm UTC](https://discuss.elastic.co/t/custom-transaction-naming/211317/1 "2019-12-10T14:30:55Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** :7.3.2

**Elasticsearch version** :7.3.2

**APM Server version** :7.3.2

**APM Agent language and version** :7.3.2

**Browser version** :Chrome - Version 76.0.3809.132

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

**Fresh install or upgraded from other 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.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :  
1.Click on APM  
2.Go to transaction Tree  
3.List Transactions

**Errors in browser console (if relevant)**: There isn't any error , but is there a way to do custom transaction naming and drilldown based on transaction ID

**Provide logs and/or server output (if relevant)**:NA

---

<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:** [December 10, 2019, 4:48pm UTC](https://discuss.elastic.co/t/custom-transaction-naming/211317/2 "2019-12-10T16:48:37Z")

</div>

Hi @Joy_Chatterjee,

You can customize transactions naming [by using API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#public-api), and using a similar code as the following in your application:

```auto
Transaction transaction = ElasticApm.currentTransaction();
if( transaction != null ) {
    transaction.setName("your-custom-name");
}

```

What do you mean exactly by `drilldown` here ? Transactions are composed of `Spans`, and you can also use the API to customize their name if needed.

---

<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:** [December 31, 2019, 12:48pm UTC](https://discuss.elastic.co/t/custom-transaction-naming/211317/3 "2019-12-31T12:48:38Z")

</div>

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