# Unknown transaction name? It's a number?

**URL:** <https://discuss.elastic.co/t/unknown-transaction-name-its-a-number/311235>\
**Category:** APM\
**Tags:** java\
**Created:** [August 2, 2022, 5:25pm UTC](https://discuss.elastic.co/t/unknown-transaction-name-its-a-number/311235 "2022-08-02T17:25:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Chapman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scott_chapman/32/108983_2.png) [@Scott\_Chapman](https://discuss.elastic.co/u/Scott_Chapman)\
**Post date:** [August 2, 2022, 5:25pm UTC](https://discuss.elastic.co/t/unknown-transaction-name-its-a-number/311235/1 "2022-08-02T17:25:48Z")

</div>

I am using the current Java APM Agent to instrument a desktop java app (not a web server). I can see transactions for some runnable classes I recognize, but I am also seem a few like `1#run` and `2#run`. Not sure what those are exactly?

Perhaps they are just anonymous classes? Or maybe just instance of Runnable itself?

---

<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:** [August 3, 2022, 7:16am UTC](https://discuss.elastic.co/t/unknown-transaction-name-its-a-number/311235/2 "2022-08-03T07:16:23Z")

</div>

Hi @Scott_Chapman ,

In order to know where does those methods come from, you can enable debug logging with `log_level=debug`, then restart your application. The lines that contain `method match` should give you a hint on the class where this method is defined, here it's very likely to be anonymous inner classes due to the numeric pattern.

If you want more deterministic naming for transactions, you can use the [Annotation API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-annotation) to make that more explicit.

---

<div class="post-metadata">

**Author:** ![Scott\_Chapman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scott_chapman/32/108983_2.png) [@Scott\_Chapman](https://discuss.elastic.co/u/Scott_Chapman)\
**Post date:** [August 3, 2022, 3:39pm UTC](https://discuss.elastic.co/t/unknown-transaction-name-its-a-number/311235/3 "2022-08-03T15:39:32Z")

</div>

Ah cool, I think I get it. Though one aspect of the docs are confusing (at least to me):

> #### `@CaptureSpan`
> 
> Annotating a method with `@CaptureSpan` creates a span as the child of the currently active span or transaction ([Span currentSpan()`).
> 
> When there is no current span, no span will be created.

I assume that the last line should say no span will be created if there is no current span or current transaction?

---

<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:** [August 4, 2022, 8:31am UTC](https://discuss.elastic.co/t/unknown-transaction-name-its-a-number/311235/4 "2022-08-04T08:31:01Z")

</div>

Yes, you are right, I've opened a [small PR](https://github.com/elastic/apm-agent-java/pull/2734) to fix this (will be visible in the next release).

---

<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:** [August 25, 2022, 4:31am UTC](https://discuss.elastic.co/t/unknown-transaction-name-its-a-number/311235/5 "2022-08-25T04:31:33Z")

</div>

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