# Tracing transactions using the headers x-request-id & x-correlation-id

**URL:** <https://community.traefik.io/t/tracing-transactions-using-the-headers-x-request-id-x-correlation-id/13869>\
**Category:** Traefik v2\
**Tags:** kubernetes-ingress\
**Created:** [March 23, 2022, 8:20am UTC](https://community.traefik.io/t/tracing-transactions-using-the-headers-x-request-id-x-correlation-id/13869 "2022-03-23T08:20:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![krobbo](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@krobbo](https://community.traefik.io/u/krobbo)\
**Post date:** [March 23, 2022, 8:20am UTC](https://community.traefik.io/t/tracing-transactions-using-the-headers-x-request-id-x-correlation-id/13869/1 "2022-03-23T08:20:43Z")

</div>

Hello,

I have traefik 2.6 deployed onto k8s, however im trying to understand if it supports tracing, specifically using the headers mentioned above?

I seen this Github issue providing a workaround, i was just wondering if there is anything officially supported or if this is the best option?

> <https://github.com/traefik/traefik/issues/4640>
>
> \### Do you want to request a \*feature\* or report a \*bug\*?
> 
> Feature
> 
> \### What… did you expect to see?
> 
> A few weeks ago, i created PR #4483 which adds support for Correlation IDs to Traefik which was closed. @juliens suggested that this might be worth discussing in a separate issue again, so here it is. 
> 
> To recap my reasoning for this feature request:
> 
> 
> \> In our environment we make heavy use of Correlation IDs to track requests throughout our mircoservice infrastructure. We recently moved from Nginx to Traefik and it brought us a lot of benefits, but the possibility to add custom headers is somewhat limited compared to Nginx. We need to add a new random UUID to every requests that comes in from outside our infrastructure to properly track it's path through the environment. This could have been done with the help of custom request headers, but those have some disadvantages:
> \> 
> \> If the header is already present, it will get overwritten. Also you cannot generate a new random UUID for every request. All you could do is generate a random UUID for every frontend each time Traefik reloads the configuration ( with the help of the spring template library ) but then you can have a lot of requests with the same correlation id. This is why we wrote a \[http middleware\](https://gitlab.com/JanMa/correlation) that adds these headers to every incoming request and would like to add it here.
> 
> There has already been PR #2290 that addressed a similar issue but it was closed at the time in favor of supporting OpenTracing. Seeing that support for OpenTracing is now present in Traefik I would like to re-open the discussion of adding Correlation ID support to Traefik. 
> 
> \> In my opinion the use case for a correlation id differs quite a lot from using a tracing engine. With correlation ids it is very easy to track an external request through all service calls in your environment. You "just" have to make sure your applications log the corresponding header name in their access logs and can easily gather all relevant log entries in a tool like Kibana. Having this information in your logging stack is incredibly useful for debugging, especially in a microservice environment. Using a tracing engine on the other hand is useful when you want to gather low level insights of your inter-service communication and see for example how long single remote procedure call takes. Also implementing full tracing support in all your services takes a lot more effort.
> 
> I think having both features available in Traefik would be very beneficial. Please let me know what your thoughts are about this :-)
> 
> Kind regards,
> Jan

Thanks
