Code style

pull/5544/head
Jorik Schellekens 2019-06-25 10:28:46 +01:00
parent 889afc11a0
commit db10eeb267
4 changed files with 8 additions and 10 deletions

View File

@ -54,7 +54,7 @@ class TracerConfig(Config):
# The list is a list of regex which is matched against the user_id
user_whitelist:
- "*"
# The list of homeservers we wish to trace across
# The list of homeservers we wish to trace across
# The list is a list of regex which is matched against the homeserver name
homeserver_whitelist:
- "*"

View File

@ -239,7 +239,7 @@ class SynapseRequest(Request):
# Start a span
span_context = extract_span_context(self.requestHeaders)
span = opentracing.tracer.start_active_span(
opentracing.tracer.start_active_span(
"incoming-federation-request",
tags={
"request_id": self.get_request_id(),

View File

@ -15,8 +15,8 @@ class LogContextScopeManager(ScopeManager):
def __init__(self, config):
# Set the whitelists
logger.info(config.tracer_config)
_homeserver_whitelist = config.tracer_config["homeserver_whitelist"]
_user_whitelist = config.tracer_config["user_whitelist"]
self._homeserver_whitelist = config.tracer_config["homeserver_whitelist"]
self._user_whitelist = config.tracer_config["user_whitelist"]
@property
def active(self):
@ -27,7 +27,7 @@ class LogContextScopeManager(ScopeManager):
becomes an implicit parent of any newly-created Span at
Tracer.start_active_span() time.
Return:
Return:
(Scope) : the Scope that is active, or None if not
available.
"""
@ -44,8 +44,8 @@ class LogContextScopeManager(ScopeManager):
span (Span): the span that should become active.
finish_on_close (Boolean): whether Span should be automatically
finished when Scope.close() is called.
Return:
Return:
Scope to control the end of the active period for
*span*. It is a programming error to neglect to call
Scope.close() on the returned instance.

View File

@ -1,8 +1,6 @@
import opentracing
from opentracing.propagation import Format
from .logcontext import LoggingContext
def extract_span_context(headers):
"""
@ -30,7 +28,7 @@ def inject_span_context(headers, span):
The headers set by the tracer are custom to the tracer implementation which
should be unique enough that they don't interfere with any headers set by
synapse or twisted. If we're still using jaeger these headers would be those
here:
here:
https://github.com/jaegertracing/jaeger-client-python/blob/master/jaeger_client/constants.py
"""
carrier = {}