Log `Synapse-Trace-Id` header on requests
This allows correlating the logs with the synapse logs in case of a problem.
See https://github.com/matrix-org/synapse/issues/9480
I'm not sure I understand the intention behind this issue, if you could provide additional info @bwindels, that would be really helpful.
- Is the idea to log the
Synapse-Trace-Idheader of all responses? Won't that flood the log, since we'll be logging all responses (that carry theSynapse-Trace-Idheader)? - At what level should the logging happen (info, debug, other)?
- Should other information about the request/response be logged along with the header, e.g. URL or other information?
Thanks!
I'm not sure I understand the intention behind this issue, if you could provide additional info @bwindels, that would be really helpful.
Sorry that I didn't see this before!
Synapse can be configured to trace how it processes incoming requests using a tool called Jaeger. This provides detailed insight in how a request was processed. On matrix.org, currently 1% of requests are traced. Specific users can also be configured to always have their requests traced. Ideally, whenever a request is traced, the trace-id would be logged on the client side in such a way that it is contained in debug logs. That way client and server logs can be put together and you might be a better understanding of a bug.
* Is the idea to log the `Synapse-Trace-Id` header of all responses? Won't that flood the log, since we'll be logging all responses (that carry the `Synapse-Trace-Id` header)?
Yes, only 1% if requests are traced on the server-side, so this should not flood the logs.
* At what level should the logging happen (info, debug, other)?
Not sure, anything will do as long as it ends up in the rageshake/debug logs.
* Should other information about the request/response be logged along with the header, e.g. URL or other information?
Yeah, ideally at least the url and the method.
Thanks!
matrix-js-sdk shouldn't really house Synapse-specific idioms, it should be [made] flexible enough to do this at the application level