# Java, Spring Boot 3.1.1 - The attached APM agent doesn't separate KafkaListeners and Scheduled tasks to separate transactions

**URL:** <https://discuss.elastic.co/t/java-spring-boot-3-1-1-the-attached-apm-agent-doesnt-separate-kafkalisteners-and-scheduled-tasks-to-separate-transactions/338764>\
**Category:** APM\
**Tags:** elastic-stack-monitoring, docker, java\
**Created:** [July 19, 2023, 10:16am UTC](https://discuss.elastic.co/t/java-spring-boot-3-1-1-the-attached-apm-agent-doesnt-separate-kafkalisteners-and-scheduled-tasks-to-separate-transactions/338764 "2023-07-19T10:16:03Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jonas\_Kunz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_kunz/32/110740_2.png) [@Jonas\_Kunz](https://discuss.elastic.co/u/Jonas_Kunz)\
**Post date:** [August 3, 2023, 10:03am UTC](https://discuss.elastic.co/t/java-spring-boot-3-1-1-the-attached-apm-agent-doesnt-separate-kafkalisteners-and-scheduled-tasks-to-separate-transactions/338764/21 "2023-08-03T10:03:18Z")

</div>

I would suggest you to investigate why your upstream service never samples the traces.

Alternatively, you can disable the default Kafka instrumentation via `disable_instrumentations=kafka` and manually create transactions via `@CaptureTransaction` or `trace_methods` instead.

---

<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 31, 2023, 10:03am UTC](https://discuss.elastic.co/t/java-spring-boot-3-1-1-the-attached-apm-agent-doesnt-separate-kafkalisteners-and-scheduled-tasks-to-separate-transactions/338764/22 "2023-08-31T10:03:58Z")

</div>

Closed on August 31, 2023, 10:03am UTC

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

[Previous page](https://discuss.elastic.co/t/java-spring-boot-3-1-1-the-attached-apm-agent-doesnt-separate-kafkalisteners-and-scheduled-tasks-to-separate-transactions/338764.md?page=1)
