This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Make log correlation more configurable (support analysis services, e.g. Google, New Relic) #14413
Labels
A-Logging
Synapse's logs (structured or otherwise). Not metrics.
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Enhancement
New features, changes in functionality, improvements in performance, or user-facing enhancements.
Description:
Thanks everyone who works on Synapse, it's really great.
The recent PR #13801 added the ability to specify the header from which to pull a request ID. This is a great step toward log correlation, but it more-or-less requires manual action to correlate.
I am using Google's Cloud Logging (aka Stackdriver) and logs may be correlated automatically in their tooling if the structured logs contain a
trace
key with a value following a particular convention. Something similar exists for New Relic, see discussion at Seldaek/monolog#1735).It would be awesome if Synapse could support this. I think it could be as simple as:
request
, configurable. (E.g., I would set this totrace
).method
).In my case, I am currently setting the trace-id with a little bit of lua magic with an openresty reverse proxy, e.g.:
And if this were supported, I would simply update this to include the additional data Google is looking for, e.g. the project ID. Synapse would then be responsible for hairpinning that back to me.
Alternatively, I suppose this could be viewed as more an extension of the opentracing implementation, and Synapse could read out the Trace ID from the
traceparent
header and include it somehow in the logs. However, that wouldn't address the need for making the log value configurable (e.g., prefixing it with additional cloud provider namespacing.)The text was updated successfully, but these errors were encountered: