mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 08:46:04 -04:00
Add OpenTracing for database activity. (#10113)
This adds quite a lot of OpenTracing decoration for database activity. Specifically it adds tracing at four different levels: * emit a span for each "interaction" - ie, the top level database function that we tend to call "transaction", but isn't really, because it can end up as multiple transactions. * emit a span while we hold a database connection open * emit a span for each database transaction - actual actual transaction. * emit a span for each database query. I'm aware this might be quite a lot of overhead, but even just running it on a local Synapse it looks really interesting, and I hope the overhead can be offset just by turning down the sampling frequency and finding other ways of tracing requests of interest (eg, the `force_tracing_for_users` setting).
This commit is contained in:
parent
1d143074c5
commit
9eea4646be
3 changed files with 57 additions and 30 deletions
|
@ -271,6 +271,12 @@ class SynapseTags:
|
|||
# HTTP request tag (used to distinguish full vs incremental syncs, etc)
|
||||
REQUEST_TAG = "request_tag"
|
||||
|
||||
# Text description of a database transaction
|
||||
DB_TXN_DESC = "db.txn_desc"
|
||||
|
||||
# Uniqueish ID of a database transaction
|
||||
DB_TXN_ID = "db.txn_id"
|
||||
|
||||
|
||||
# Block everything by default
|
||||
# A regex which matches the server_names to expose traces for.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue