matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.81k stars 2.13k forks source link

Consider adding the worker name to the user agent for HTTP replication calls #12807

Open turt2live opened 2 years ago

turt2live commented 2 years ago

This will help track down which worker exactly is making a request to another worker, such as where traffic on the main process might be coming from exactly.

Alternatives are to grep a bunch of logs to see if a worker can be identified, however this is extra work.

realtyem commented 1 year ago

Is this still of interest?

realtyem commented 1 year ago

If so, with the above mentioned PR, could also add

master | 2023-04-22 21:48:39,554 - synapse.http.client - 891 - DEBUG - POST-3 - Sending request POST http://event_persister1/_synapse/replication/send_events/GxzWGTCSVa
event_persister1 | 2023-04-22 21:48:39,560 - synapse.access.http.18009 - 416 - DEBUG - POST-5 - master[POST-3] - 18009 - Received request: POST /_synapse/replication/send_events/GxzWGTCSVa

as a possibility. Note specifically the master[POST-3] in the second line, which is the context/request_id from master.