Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Synapse-Trace-Id header on requests #1868

Open
bwindels opened this issue Aug 23, 2021 · 3 comments
Open

Log Synapse-Trace-Id header on requests #1868

bwindels opened this issue Aug 23, 2021 · 3 comments

Comments

@bwindels
Copy link
Contributor

This allows correlating the logs with the synapse logs in case of a problem.

See matrix-org/synapse#9480

@psrpinto
Copy link
Contributor

psrpinto commented Aug 30, 2021

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-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)?
  • 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!

@bwindels
Copy link
Contributor Author

bwindels commented Jan 2, 2023

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!

@t3chguy
Copy link
Member

t3chguy commented Jan 3, 2023

matrix-js-sdk shouldn't really house Synapse-specific idioms, it should be [made] flexible enough to do this at the application level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants