# Custom field propagation and log correlations

**URL:** <https://discuss.elastic.co/t/custom-field-propagation-and-log-correlations/191223>\
**Category:** APM\
**Tags:** java\
**Created:** [July 18, 2019, 3:05pm UTC](https://discuss.elastic.co/t/custom-field-propagation-and-log-correlations/191223 "2019-07-18T15:05:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![talenko](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@talenko](https://discuss.elastic.co/u/talenko)\
**Post date:** [July 18, 2019, 3:05pm UTC](https://discuss.elastic.co/t/custom-field-propagation-and-log-correlations/191223/1 "2019-07-18T15:05:49Z")

</div>

Hello 👋

I was combing over the docs and noticed that there is an option to enable log correlation such that the trace and span ids can be added to the MDC, which is great! However, is it possible to also include custom field propagations over the wire and have that also be added to the MDC? Essentially, I'm trying to add a X-TestId field (propagated via headers) so that when filtering through the logs/tracing output, we could easily see the source of the transactions. Currently we're using Sleuth which enables this with a bit of code but would rather rely simply on APM if possible to simplify things.

Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [July 19, 2019, 7:38am UTC](https://discuss.elastic.co/t/custom-field-propagation-and-log-correlations/191223/2 "2019-07-19T07:38:28Z")

</div>

We currently don't have a way to add labels/baggage/correlation-context which is propagated to downstream services. Once we have such an API, you could manually read the values you are interested in and add them to the MDC.

---

<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 9, 2019, 3:38am UTC](https://discuss.elastic.co/t/custom-field-propagation-and-log-correlations/191223/3 "2019-08-09T03:38:28Z")

</div>

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