tailscale/tsweb
Marwan Sulaiman b819f66eb1 tsweb: propagate RequestID via context and entire request
The recent addition of RequestID was only populated if the
HTTP Request had returned an error. This meant that the underlying
handler has no access to this request id and any logs it may have
emitted were impossible to correlate to that request id. Therefore,
this PR adds a middleware to generate request ids and pass them
through the request context. The tsweb.StdHandler automatically
populates this request id if the middleware is being used. Finally,
inner handlers can use the context to retrieve that same request id
and use it so that all logs and events can be correlated.

Updates #2549

Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
2023-11-30 15:00:29 -05:00
..
promvarz tsweb/promvarz: fix repeated expvar definition in test 2023-05-06 09:53:09 -07:00
varz tsweb/varz: fix exporting histograms 2023-09-07 14:52:59 -07:00
debug_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
debug.go tsweb: clean up pprof handler registration, document why it's there 2023-08-23 10:16:14 -07:00
log.go tsweb: propagate RequestID via context and entire request 2023-11-30 15:00:29 -05:00
request_id.go tsweb: propagate RequestID via context and entire request 2023-11-30 15:00:29 -05:00
tsweb_test.go tsweb: propagate RequestID via context and entire request 2023-11-30 15:00:29 -05:00
tsweb.go tsweb: propagate RequestID via context and entire request 2023-11-30 15:00:29 -05:00