# APM Traces for thrift server and getting clubbed into doPost

**URL:** <https://discuss.elastic.co/t/apm-traces-for-thrift-server-and-getting-clubbed-into-dopost/248286>\
**Category:** APM\
**Tags:** java\
**Created:** [September 11, 2020, 8:19am UTC](https://discuss.elastic.co/t/apm-traces-for-thrift-server-and-getting-clubbed-into-dopost/248286 "2020-09-11T08:19:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilip1992](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@dilip1992](https://discuss.elastic.co/u/dilip1992)\
**Post date:** [September 11, 2020, 8:19am UTC](https://discuss.elastic.co/t/apm-traces-for-thrift-server-and-getting-clubbed-into-dopost/248286/1 "2020-09-11T08:19:46Z")

</div>

I have integrated my java thrift service with APM.  
Transactions are not getting segregated according to the functions.  
All the functions exposed in thrift are getting clubbed in doPost transactions.  
Is there any way to get transactions listed by functions inside my thrift service?

---

<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:** [September 15, 2020, 2:19pm UTC](https://discuss.elastic.co/t/apm-traces-for-thrift-server-and-getting-clubbed-into-dopost/248286/2 "2020-09-15T14:19:14Z")

</div>

Hi @dilip1992, welcome to our forum !

I am not familiar with Thrift framework, can you confirm that it's [Apache Thrift](http://thrift.apache.org/) ?

From what I understand, it's an RPC framework, thus I guess that in your case there is

- a dispatcher Servlet that our agent instruments at the `doPost` method level and creates transactions for every HTTP request. This Servlet dispaches calls to a service defined with Thrift
- a Thrift _service layer_ that have some entry points (functions) that you want to use to properly name your transactions.

Does Thrift has a concept of a filter or dispatcher where you can wrap a call to the Thrift layer ? If yes, that means you can easily use [agent API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html) to set the transaction name accordingly with something similar to :

```auto
String thriftFunctionName = null; // get value from Thrift filter or similar
Transaction transaction = ElasticApm.currentTransaction();
transaction.setName(thriftFunctionName);

```

---

<div class="post-metadata">

**Author:** ![dilip1992](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@dilip1992](https://discuss.elastic.co/u/dilip1992)\
**Post date:** [September 25, 2020, 4:19am UTC](https://discuss.elastic.co/t/apm-traces-for-thrift-server-and-getting-clubbed-into-dopost/248286/3 "2020-09-25T04:19:19Z")

</div>

Hey Sylvain,

```
 Yes, I am using apache thrift. It is an RPC framework.
 Setting a name to the current transaction worked.
 Thank you for your help.
```

---

<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:** [October 16, 2020, 12:19am UTC](https://discuss.elastic.co/t/apm-traces-for-thrift-server-and-getting-clubbed-into-dopost/248286/4 "2020-10-16T00:19:24Z")

</div>

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