reitit

István Karaszi 2024-08-21T09:29:46.876419Z

Request tracing We would like to implement a tracing option between the clients and the servers. There is an option to simply generate a UUID to the X-Request-ID HTTP header or there is this Trace Context thing from W3C https://www.w3.org/TR/trace-context/ Is any of you doing something like this?

joshuamz 2024-08-21T09:48:15.474369Z

For our API, we added a middleware to inject an https://github.com/theikkila/clj-ulid value upon receiving a request map, and returns the same value as a X-Request-ID response header. In our specific case, it is very helpful to provide that request ID in the Timbre context with taoensso.timbre/with-context+. For it to work, we provided a custom log formatter fn to Timbre. YMMV.

👍 1
István Karaszi 2024-08-21T09:49:31.671569Z

I am leaning to implement the W3C Trace Context since that seems to be the future and also one of the components supports that already.

👍 1
ilmo 2024-08-21T10:44:59.161279Z

If you’re interested, I created this microlibrary for generation and parsing of W3C trace contexts: https://github.com/ilmoraunio/clj-w3c-trace-context

👍 1
István Karaszi 2024-08-21T10:47:16.220989Z

Absolutely!