ironsmile / nedomi

Highly performant HTTP reverse proxy with efficient caching of big files
GNU General Public License v3.0
81 stars 9 forks source link

Request ID #191

Closed mstoykov closed 9 years ago

mstoykov commented 9 years ago

Currently in a lot of places we write the address of the handler currently processing the request. This has downsides:

  1. no easy and consistent way to trace request between different handlers
  2. the address are heavily reused

because of this I propose each request to have it's own ID. that is given to it when the request is accepted in app/net.go. This id can than be put inside the context and used where ever needed.

This raises some additional questions:

Meaningful Information is understood non exclusively to include:

mstoykov commented 9 years ago

My proposal is:

47e220fb5eb29f3ec6bedb881d2424cb
47e220fb5eb29f3ec6bedb881d2424cb->fcc8157a14195d55303ca4846bb9d379

  • The server id should probably be a config option of sort. Maybe one for the size of the request id. What information is logged at request id creation could be configurable as well.
ironsmile commented 9 years ago

:+1: I think it would be a great idea to add it in the response headers as an X-* header. Maybe X-RID. This maybe configurable as well. In some situations we may want it, in others - not.