-
Notifications
You must be signed in to change notification settings - Fork 375
Switch to OpenTracing's ContextVarsScopeManager
#18849
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
Switch to OpenTracing's ContextVarsScopeManager
#18849
Conversation
Instead of our own `LogContextScopeManager`
@@ -54,17 +56,18 @@ | |||
logger = logging.getLogger(__name__) | |||
|
|||
|
|||
class LogContextScopeManagerTestCase(TestCase): | |||
class TracingScopeTestCase(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though we've removed the LogContextScopeManager
now, I've decided to keep these tests around. They appear like good sanity checks to make sure our tracing still works with Twisted regardless of what we try to use.
ContextVarsScopeManager
ContextVarsScopeManager
a9d7008
to
b1f308c
Compare
These changes are being introduced in #18849 instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Thanks for the review @anoadragon453 🐍 |
…e while writing bytes to the request (#18804) This will allow to easily see how much time is taken up by being able to filter by the `write_bytes_to_request` operation in Jaeger. Spawning from #17722 The `write_bytes_to_request` span won't show up in the trace until #18849 is merged. Note: It's totally fine for a span child to finish after the parent. See https://opentracing.io/specification/#references-between-spans which shows "Child Span D" outliving the "Parent Span"
Switch to OpenTracing's
ContextVarsScopeManager
instead of our own customLogContextScopeManager
.This is now possible because the linked Twisted issue from this comment is resolved:
synapse/synapse/logging/scopecontextmanager.py
Lines 42 to 43 in 40edb10
This PR is spawning from exploring different possibilities to solve the
scope
loss problem I was encountering in #18804 (comment). This appears to solve the problem and I've added the additional test from there to this PR ✅Related to #10342 (previously matrix-org/synapse#10342) where we also want to change our
LoggingContext
machinery to baseContextVar
based.Testing strategy
homeserver.yaml
opentracing
depdency is installed:poetry install --extras all
poetry run synapse_homeserver --config-path homeserver.yaml
GET http://localhost:8008/_matrix/client/versions
Servlet
'sI tested a few endpoints and the traces seem to look normal.
Dev notes
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.