# APM transaction not shown in request but clearly in custom

**URL:** <https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574>\
**Category:** APM\
**Tags:** elastic-stack-monitoring, java\
**Created:** [April 28, 2025, 12:03pm UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574 "2025-04-28T12:03:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnuragAgarwal](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@AnuragAgarwal](https://discuss.elastic.co/u/AnuragAgarwal)\
**Post date:** [April 28, 2025, 12:03pm UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/1 "2025-04-28T12:03:45Z")

</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 🙂

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server related questions, `java` for questions regarding the Elastic APM Java agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**APM Agent language and version** : Java 17 and Elastic APM 1.53.0

**Steps to reproduce** :

1. When I try to attach the apm agent to my spring boot 3.4.2 version, all transactions shown in request tab are GET UNKNOWN route or POST unknown route
2. I suspect APM is not able to attach the spring MVC agent.
3. the transactions are correctly shown in custom tag but not in request. I have tried both enable\_type\_matching\_name\_pre\_filtering and enabling disabling servelt-api and spring mvc agent via attach properties.

**Errors in browser console (if relevant)**:

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

---

<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:** [April 28, 2025, 12:23pm UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/2 "2025-04-28T12:23:06Z")

</div>

Hi,

This might be a limitation of the APM Java agent with current version of Spring boot.

Could you provide a very simple sample spring-boot application that allows to reproduce the issue ? Without this it might be quite hard for us to investigate further the issue you reported.

As an alternative, I would suggest to attempt using the [EDOT Java agent](https://github.com/elastic/elastic-otel-java) which is based on OpenTelemetry, as it likely provides a more extensive support for Spring-Boot applications.

If the issue persists with EDOT, then it means the issue is not related to the application instrumentation but is likely with the data ingestion.

---

<div class="post-metadata">

**Author:** ![AnuragAgarwal](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@AnuragAgarwal](https://discuss.elastic.co/u/AnuragAgarwal)\
**Post date:** [April 28, 2025, 6:13pm UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/3 "2025-04-28T18:13:11Z")

</div>

thanks @Sylvain_Juge is there a way to replace my APM configuration class in spring boot application to switch to EDOT, I coudnt find an article on spring boot migration.  
The nearest match I found is [Setup | EDOT](https://elastic.github.io/opentelemetry/edot-sdks/java/setup/index.html) but was wondering is there something for spring boot.

---

<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:** [April 29, 2025, 12:04pm UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/4 "2025-04-29T12:04:02Z")

</div>

This is not yet in the main documentation, but we provide a `runtime-attach` artifact that allows an easy setup with spring-boot. In addition this includes the agent in the application and you don't have to deal with `-javaagent` JVM argument.

The documentation is available here: [elastic-otel-java/runtime-attach at main · elastic/elastic-otel-java · GitHub](https://github.com/elastic/elastic-otel-java/tree/main/runtime-attach)

---

<div class="post-metadata">

**Author:** ![AnuragAgarwal](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@AnuragAgarwal](https://discuss.elastic.co/u/AnuragAgarwal)\
**Post date:** [April 29, 2025, 2:59pm UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/5 "2025-04-29T14:59:17Z")

</div>

@Sylvain_Juge Perfect it works for us, I explored the runtime-attach, it works for us...the only issue I see currently is not getting the controller and service level trace in the transaction, goes from HTTP request to DB, might be we need to explore instrumentation options but we agree this as a way forward.

---

<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:** [April 30, 2025, 7:00am UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/6 "2025-04-30T07:00:25Z")

</div>

> [@AnuragAgarwal](#):
>
> not getting the controller and service level trace

Can you elaborate what do you mean by that ?

- do you see any transactions when doing HTTP requests on your application ?
- what kind of transactions do you observe in Kibana UI ? Maybe provide a screenshot to make it more clear.

---

<div class="post-metadata">

**Author:** ![AnuragAgarwal](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@AnuragAgarwal](https://discuss.elastic.co/u/AnuragAgarwal)\
**Post date:** [April 30, 2025, 7:15am UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/7 "2025-04-30T07:15:15Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/0/70522b2775c35b69693a1ecb805c6bd5f8a0567c.png)  
SO we miss the controller service layer flow, is that something we can customise.

---

<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:** [April 30, 2025, 8:59am UTC](https://discuss.elastic.co/t/apm-transaction-not-shown-in-request-but-clearly-in-custom/377574/8 "2025-04-30T08:59:17Z")

</div>

Here do you mean the spring controllers or the internal application "business logic" ?  
The spring controllers instrumentation is [enabled by default](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/out-of-the-box-instrumentation/), and if you look at the transaction metadata you should see in the attributes which instrumentation created the spans/attributes.

Given your screenshot, I am assuming that you need to know what is happening in your application within the 96ms of the `POST /products` that are not spent on the 1.1ms `postgres` database call, is that correct ?

The instrumentation agent only instruments the [supported libraries and frameworks](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md#libraries--frameworks), which does not include the application internals as the agent can't guess the application architecture.

What you could try though is to use [inferred spans](https://elastic.github.io/opentelemetry/edot-sdks/java/features.html#inferred-spans) feature by setting `OTEL_INFERRED_SPANS_ENABLED` environment variable to `true`, this will use a sampling profiler and generate all the intermediate spans without prior knowledge of the application architecture.
