# Transaction names are hex after agent upgrade

**URL:** <https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136>\
**Category:** APM\
**Tags:** java\
**Created:** [May 6, 2022, 2:38pm UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136 "2022-05-06T14:38:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethranes](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@ethranes](https://discuss.elastic.co/u/ethranes)\
**Post date:** [May 6, 2022, 2:38pm UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/1 "2022-05-06T14:38:25Z")

</div>

We've recently done an APM Java agent upgrade from 1.17 to 1.30.1. For most of our APM monitoring things have gone smoothly but one of our services, all of the transaction names are coming through as hex values instead of the method names. Can anyone help with why this may have happened, and only on one service?

 ![Screenshot 2022-05-06 155633](https://us1.discourse-cdn.com/elastic/original/3X/8/a/8abb25cbecff0b54c0aada9d1c383b44bafb173d.png)

---

<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 6, 2022, 3:28pm UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/2 "2022-05-06T15:28:47Z")

</div>

Hi @ethranes ,

Do you know what type of transaction is being captured here ?  
What are the names that were previously used in those transactions ?  
Also, could you share a copy of the transaction document ?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [May 6, 2022, 4:40pm UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/3 "2022-05-06T16:40:19Z")

</div>

This is probably because we've added auto-instrumentation support for `TimerTask` in [1.18.0](https://www.elastic.co/guide/en/apm/agent/java/current/release-notes-1.x.html#release-notes-1.18.0.rc1). Does `BaseProcessor` have `TimerTask` as a super class?

The hash might be a sign that the task is implemented as an anonymous inner class or as a lambda function.

Transactions that are created from a timer task have the type `scheduled`. The UI doesn't mix them with the `request` type. So if you can't see the HTTP request transaction of your application, you probably just need to switch the transaction type in the dropdown.

 ![apm-transactions-overview](https://us1.discourse-cdn.com/elastic/original/3X/0/8/08981023e490c9d57210bda0b176cdbebfbe9f84.png)

---

<div class="post-metadata">

**Author:** ![Swapnil\_Sonawane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swapnil_sonawane/32/99073_2.png) [@Swapnil\_Sonawane](https://discuss.elastic.co/u/Swapnil_Sonawane)\
**Post date:** [May 8, 2022, 2:53pm UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/4 "2022-05-08T14:53:01Z")

</div>

We were using 1.17 earlier and the type of the transaction was custom. Previously, the names of the transactions were like ABCProcessor, XYZProcessor where the hierarchy is like ABCProcessor extends BaseProcessor extends TimerTask. The names like ABCProcessor have been configured under trace\_methods property in the elasticapm.properties file. The hexvalue#run (hex seems to be cglib proxy instance name) do show up as transaction type scheduled, but the there's no transactions with the name we've configured under trace\_methods after the upgrade. Also, the hex values obviously change after the restart, so can't really identify transactions like that.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [May 8, 2022, 4:33pm UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/5 "2022-05-08T16:33:37Z")

</div>

Thanks for the hint that it's a cglib proxy. I've filed an issue to prevent the `TimerTask` instrumentation from instrumenting proxies:

> <https://github.com/elastic/apm-agent-java/issues/2618>
>
> The type matcher of the \`TimerTaskInstrumentation\` is missing a \`and(not(co.elas…tic.apm.agent.bci.bytebuddy.CustomElementMatchers.isProxy()))\` clause:
> 
> https://github.com/elastic/apm-agent-java/blob/a1f1e1882fe52c662cb7e9e042963ab63cc4fdb2/apm-agent-plugins/apm-scheduled-annotation-plugin/src/main/java/co/elastic/apm/agent/scheduled/TimerTaskInstrumentation.java#L89-L92
> 
> Reported in the \[forum\](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/4).

You have two options to work around the issue:

- Set [`classes_excluded_from_instrumentation`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-classes-excluded-from-instrumentation) to `*$Proxy*,*$$*,*$JaxbAccessor*,*CGLIB*,*EnhancerBy*`. You can also remove the `trace_methods` setting as the transactions will be created by the dedicated `TimeTask` instrumentation.
- Set [`disable_instrumentations`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-disable-instrumentations) to `timer-task` so that only the `trace_methods` setting will create transactions for your tasks.

---

<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 9, 2022, 6:19am UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/6 "2022-05-09T06:19:45Z")

</div>

@Swapnil_Sonawane please try [this snapshot](https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-java%2Fapm-agent-java-mbp/detail/PR-2620/1/artifacts) without your original `trace_methods` configuration (and without `classes_excluded_from_instrumentation` or `disable_instrumentations` configs if you added such) and let us know if you get properly-named transactions.  
Make sure to check the `scheduled` transaction types for those.

---

<div class="post-metadata">

**Author:** ![ethranes](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@ethranes](https://discuss.elastic.co/u/ethranes)\
**Post date:** [May 10, 2022, 10:05am UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/7 "2022-05-10T10:05:35Z")

</div>

Thanks for your help both, we've opted to go for adding timer-task to disable\_instrumentations for now. That has done the trick, but like you say, they're now registering as custom transactions, which is fine to be honest. We'll keep an eye on [`TimerTaskInstrumentation` instruments proxies · Issue #2618 · elastic/apm-agent-java · GitHub](https://github.com/elastic/apm-agent-java/issues/2618) and look to updating our agents again in a later build. Cheers!

---

<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 10, 2022, 11:02am UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/8 "2022-05-10T11:02:43Z")

</div>

> [@ethranes](#):
>
> We'll keep an eye on [`TimerTaskInstrumentation` instruments proxies · Issue #2618 · elastic/apm-agent-java · GitHub](https://github.com/elastic/apm-agent-java/issues/2618) and look to updating our agents again in a later build. Cheers!

There is already a fix for this issue - [Exclude proxies in TimerTaskInstrumentation by eyalkoren · Pull Request #2620 · elastic/apm-agent-java · GitHub](https://github.com/elastic/apm-agent-java/pull/2620). What I asked is that you verify that this fix works as expected, so that you and other users will get everything traced as expected out-of-the-box.  
Using the builtin transactions will also provide additional data for your transactions.  
Whenever possible, it's best to rely on inherent agent capabilities, so doing this extra effort to test the fix will not only serve other users, but you as well.  
Thank you.

---

<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 17, 2022, 11:30am UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/9 "2022-05-17T11:30:06Z")

</div>

Version [1.31.0](https://www.elastic.co/guide/en/apm/agent/java/current/release-notes-1.x.html#release-notes-1.31.0) has been released with the related fix.  
With this version, `TimerTask` transactions should be named properly without any special configuration.

---

<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 7, 2022, 7:30am UTC](https://discuss.elastic.co/t/transaction-names-are-hex-after-agent-upgrade/304136/10 "2022-06-07T07:30:49Z")

</div>

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