# How to do distributed tracing with our own traceparent?

**URL:** <https://discuss.elastic.co/t/how-to-do-distributed-tracing-with-our-own-traceparent/382700>\
**Category:** Elastic Observability\
**Created:** [October 14, 2025, 11:35am UTC](https://discuss.elastic.co/t/how-to-do-distributed-tracing-with-our-own-traceparent/382700 "2025-10-14T11:35:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilsen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nilsen/32/146631_2.png) [@nilsen](https://discuss.elastic.co/u/nilsen)\
**Post date:** [October 14, 2025, 11:35am UTC](https://discuss.elastic.co/t/how-to-do-distributed-tracing-with-our-own-traceparent/382700/1 "2025-10-14T11:35:17Z")

</div>

We currently have an sequence ID that is shared/accessible for all our _micro_-services. And I'm wondering if there is a way to reuse this ID in the `traceparent`.

**My goal is that all our services can do tracing to the correct trace only using this already shared sequence ID. Anyone have any suggestions?**

I have read about distributed tracing, but it all seems very related to HTTP requests. Not all of our services start with HTTP. Also that would mean propagating the `traceparent` everywhere, when we already have our sequence ID accessible for all services. Our service chain can be decently long, some are HTTP requests, some are schedulers looking for work in a database, some services start with JMS (ActiveMQ), some a Java main loop looking for files on disk.

**Other thoughts**

I can create my own `traceparent`, and change the `trace_id` part, and pad my sequence ID with zeros:

`{version}-0000000000000000{sequence ID}-{span_id}-{trace_flags}`

But when I use this with `ElasticApm.startTransactionWithRemoteParent(...)` I get detached spans. I'm guessing this is because with `ElasticApm.startTransactionWithRemoteParent(...)` assume a transaction already exists, which is does not for the first service.

**Stack version:** 9.1.5 _(Fleet with Elastic APM integration)_  
**Dependency:** co.elastic.apm:apm-agent-api:1.55.1  
**Java version:** 17
