# Elastic Java Agent with CometD for Event based tracing

**URL:** <https://discuss.elastic.co/t/elastic-java-agent-with-cometd-for-event-based-tracing/356733>\
**Category:** APM\
**Tags:** java\
**Created:** [April 4, 2024, 4:43am UTC](https://discuss.elastic.co/t/elastic-java-agent-with-cometd-for-event-based-tracing/356733 "2024-04-04T04:43:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [April 4, 2024, 4:43am UTC](https://discuss.elastic.co/t/elastic-java-agent-with-cometd-for-event-based-tracing/356733/1 "2024-04-04T04:43:27Z")

</div>

Hi,

I am currently using elastic java agent 1.36.0.

The application I am trying to capture traces has Kafka calls based on events i.e, some of the services are event based while some are HTTP based.

This application has below dependency: **org.cometd.java**

```auto
<dependency>
    <groupId>org.cometd.java</groupId>
    <artifactId>bayeux-api</artifactId>
    <version>xx</version>
</dependency>

```

Its been used for event based message handling.  
However, when I am trying to run the transactions for the application, I am unable to track the parent transaction that triggered the kafka event i.e, they show up as transactions instead of span to some parent transaction.

I suspect the cometD dependency which is not supported frameworks of java agent causing a problem.  
Is it possible? If yes , Is there any way It can be handled?

Also, Are traces for websocket based connection between services supported by the java agent ?

Awaiting your suggestion/advise on above query.

Best Regards,  
Namita Jaokar

---

<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:** [April 8, 2024, 11:26am UTC](https://discuss.elastic.co/t/elastic-java-agent-with-cometd-for-event-based-tracing/356733/2 "2024-04-08T11:26:04Z")

</div>

Like you said, the comet-D library is not explicitly supported by the agent. I think your only option to support distributed tracing with it would be to write a [custom plugin](https://www.elastic.co/guide/en/apm/agent/java/current/plugin-api.html).

---

<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:** [May 6, 2024, 11:27am UTC](https://discuss.elastic.co/t/elastic-java-agent-with-cometd-for-event-based-tracing/356733/3 "2024-05-06T11:27:02Z")

</div>

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