forked-synapse/synapse
Jorik Schellekens 38a6d3eea7
Add basic opentracing support (#5544)
* Configure and initialise tracer

Includes config options for the tracer and sets up JaegerClient.

* Scope manager using LogContexts

We piggy-back our tracer scopes by using log context.
The current log context gives us the current scope. If new scope is
created we create a stack of scopes in the context.

* jaeger is a dependency now

* Carrier inject and extraction for Twisted Headers

* Trace federation requests on the way in and out.

The span is created in _started_processing and closed in
_finished_processing because we need a meaningful log context.

* Create logcontext for new scope.

Instead of having a stack of scopes in a logcontext we create a new
context for a new scope if the current logcontext already has a scope.

* Remove scope from logcontext if logcontext is top level

* Disable tracer if not configured

* typo

* Remove dependence on jaeger internals

* bools

* Set service name

* :Explicitely state that the tracer is disabled

* Black is the new black

* Newsfile

* Code style

* Use the new config setup.

* Generate config.

* Copyright

* Rename config to opentracing

* Remove user whitelisting

* Empty whitelist by default

* User ConfigError instead of RuntimeError

* Use isinstance

* Use tag constants for opentracing.

* Remove debug comment and no need to explicitely record error

* Two errors a "s(c)entry"

* Docstrings!

* Remove debugging brainslip

* Homeserver Whitlisting

* Better opentracing config comment

* linting

* Inclue worker name in service_name

* Make opentracing an optional dependency

* Neater config retreival

* Clean up dummy tags

* Instantiate tracing as object instead of global class

* Inlcude opentracing as a homeserver member.

* Thread opentracing to the request level

* Reference opetnracing through hs

* Instantiate dummy opentracin g for tests.

* About to revert, just keeping the unfinished changes just in case

* Revert back to global state, commit number:

9ce4a3d9067bf9889b86c360c05ac88618b85c4f

* Use class level methods in tracerutils

* Start and stop requests spans in a place where we
have access to the authenticated entity

* Seen it, isort it

* Make sure to close the active span.

* I'm getting black and blue from this.

* Logger formatting

Co-Authored-By: Erik Johnston <erik@matrix.org>

* Outdated comment

* Import opentracing at the top

* Return a contextmanager

* Start tracing client requests from the servlet

* Return noop context manager if not tracing

* Explicitely say that these are federation requests

* Include servlet name in client requests

* Use context manager

* Move opentracing to logging/

* Seen it, isort it again!

* Ignore twisted return exceptions on context exit

* Escape the scope

* Scopes should be entered to make them useful.

* Nicer decorator names

* Just one init, init?

* Don't need to close something that isn't open

* Docs make you smarter
2019-07-11 10:36:03 +01:00
..
_scripts Run Black. (#5482) 2019-06-20 19:32:02 +10:00
api Run Black. (#5482) 2019-06-20 19:32:02 +10:00
app Add basic opentracing support (#5544) 2019-07-11 10:36:03 +01:00
appservice Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2019-07-04 00:07:04 +10:00
config Add basic opentracing support (#5544) 2019-07-11 10:36:03 +01:00
crypto Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2019-07-04 00:07:04 +10:00
events Add origin_server_ts and sender fields to m.replace (#5613) 2019-07-05 17:20:02 +01:00
federation Add basic opentracing support (#5544) 2019-07-11 10:36:03 +01:00
groups Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2019-07-04 00:07:04 +10:00
handlers Inline issue_access_token (#5659) 2019-07-11 04:10:07 +10:00
http Add basic opentracing support (#5544) 2019-07-11 10:36:03 +01:00
logging Add basic opentracing support (#5544) 2019-07-11 10:36:03 +01:00
metrics Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2019-07-04 00:07:04 +10:00
module_api Remove access-token support from RegistrationHandler.register (#5641) 2019-07-08 19:01:08 +01:00
push Add default push rule to ignore reactions (#5623) 2019-07-05 17:37:52 +01:00
replication Remove access-token support from RegistrationHandler.register (#5641) 2019-07-08 19:01:08 +01:00
res/templates Change password reset links to /_matrix. 2019-06-11 11:34:33 +01:00
rest Don't bundle aggregations when retrieving the original event (#5654) 2019-07-10 14:43:11 +01:00
server_notices Run Black. (#5482) 2019-06-20 19:32:02 +10:00
state Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2019-07-04 00:07:04 +10:00
static Revert redundant changes to static js 2019-06-26 22:46:23 +01:00
storage Remove access-token support from RegistrationStore.register (#5642) 2019-07-10 16:26:49 +01:00
streams Fix /messages on workers when no from param specified. 2019-06-24 10:06:51 +01:00
util Fixes to the federation rate limiter (#5621) 2019-07-05 11:10:19 +01:00
__init__.py 1.1.0 2019-07-04 11:44:09 +01:00
event_auth.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
notifier.py Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2019-07-04 00:07:04 +10:00
python_dependencies.py Add basic opentracing support (#5544) 2019-07-11 10:36:03 +01:00
secrets.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
server.py cleanups 2019-06-27 00:37:41 +01:00
server.pyi Run Black. (#5482) 2019-06-20 19:32:02 +10:00
types.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
visibility.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00