# APM, Jaeger and trace.id

**URL:** <https://discuss.elastic.co/t/apm-jaeger-and-trace-id/234978>\
**Category:** APM\
**Created:** [May 29, 2020, 7:29pm UTC](https://discuss.elastic.co/t/apm-jaeger-and-trace-id/234978 "2020-05-29T19:29:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tstadler](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tstadler](https://discuss.elastic.co/u/tstadler)\
**Post date:** [May 29, 2020, 7:29pm UTC](https://discuss.elastic.co/t/apm-jaeger-and-trace-id/234978/1 "2020-05-29T19:29:02Z")

</div>

**Kibana version** : 7.7.0

**Elasticsearch version** : 7.7.0

**APM Server version** : 7.7.0

I am using the apm-server with jaeger grpc enabled and a jaeger tracer as client and ECS logging in my application.

The apm-server stores the first span with the fields transaction.id and trace.id. The value of transaction.id is e.g. 7890b687652000e, while the value of trace.id is 0000000000000000a7890b687652000e. The value of the trace.id field in my application logs is 7890b687652000e.

When using the trace logs action in the APM app, the search field in populated with `trace.id:"0000000000000000a7890b687652000e" OR 0000000000000000a7890b687652000e`and no logs are found. When I change the query to `trace.id:"a7890b687652000e" OR a7890b687652000e` my logs are found.

Is it possible to store the trace.id field without the leading zeros?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [June 2, 2020, 9:06am UTC](https://discuss.elastic.co/t/apm-jaeger-and-trace-id/234978/2 "2020-06-02T09:06:46Z")

</div>

It sounds to me like the Jaeger client you're using is generating 64-bit trace IDs. I think it would be reasonable for APM Server to detect 64-bit IDs in the Jaeger intake, and drop the first 16 zeros. We would still left-pad with zeros to 16 characters though.

So a7890b687652000e would be recorded as-is, but 7652000e would be recorded as 000000007652000e. I believe that would be in line with what Jaeger clients do, e.g. here's how the Jaeger Go client formats trace IDs: [https://github.com/jaegertracing/jaeger-client-go/blob/v2.23.1/span\_context.go#L333](https://github.com/jaegertracing/jaeger-client-go/blob/v2.23.1/span_context.go#L333)

How does that sound to you?

---

<div class="post-metadata">

**Author:** ![tstadler](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tstadler](https://discuss.elastic.co/u/tstadler)\
**Post date:** [June 2, 2020, 9:29am UTC](https://discuss.elastic.co/t/apm-jaeger-and-trace-id/234978/3 "2020-06-02T09:29:24Z")

</div>

Sounds great. Thank you!

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [June 3, 2020, 12:50am UTC](https://discuss.elastic.co/t/apm-jaeger-and-trace-id/234978/4 "2020-06-03T00:50:35Z")

</div>

Great. I've filed an issue, please subscribe if you would like to be updated: [https://github.com/elastic/apm-server/issues/3837](https://github.com/elastic/apm-server/issues/3837).

---

<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:** [June 23, 2020, 8:50pm UTC](https://discuss.elastic.co/t/apm-jaeger-and-trace-id/234978/5 "2020-06-23T20:50:38Z")

</div>

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