Code style
parent
889afc11a0
commit
db10eeb267
|
@ -54,7 +54,7 @@ class TracerConfig(Config):
|
||||||
# The list is a list of regex which is matched against the user_id
|
# The list is a list of regex which is matched against the user_id
|
||||||
user_whitelist:
|
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
|
# The list is a list of regex which is matched against the homeserver name
|
||||||
homeserver_whitelist:
|
homeserver_whitelist:
|
||||||
- "*"
|
- "*"
|
||||||
|
|
|
@ -239,7 +239,7 @@ class SynapseRequest(Request):
|
||||||
|
|
||||||
# Start a span
|
# Start a span
|
||||||
span_context = extract_span_context(self.requestHeaders)
|
span_context = extract_span_context(self.requestHeaders)
|
||||||
span = opentracing.tracer.start_active_span(
|
opentracing.tracer.start_active_span(
|
||||||
"incoming-federation-request",
|
"incoming-federation-request",
|
||||||
tags={
|
tags={
|
||||||
"request_id": self.get_request_id(),
|
"request_id": self.get_request_id(),
|
||||||
|
|
|
@ -15,8 +15,8 @@ class LogContextScopeManager(ScopeManager):
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
# Set the whitelists
|
# Set the whitelists
|
||||||
logger.info(config.tracer_config)
|
logger.info(config.tracer_config)
|
||||||
_homeserver_whitelist = config.tracer_config["homeserver_whitelist"]
|
self._homeserver_whitelist = config.tracer_config["homeserver_whitelist"]
|
||||||
_user_whitelist = config.tracer_config["user_whitelist"]
|
self._user_whitelist = config.tracer_config["user_whitelist"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def active(self):
|
def active(self):
|
||||||
|
@ -27,7 +27,7 @@ class LogContextScopeManager(ScopeManager):
|
||||||
becomes an implicit parent of any newly-created Span at
|
becomes an implicit parent of any newly-created Span at
|
||||||
Tracer.start_active_span() time.
|
Tracer.start_active_span() time.
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
(Scope) : the Scope that is active, or None if not
|
(Scope) : the Scope that is active, or None if not
|
||||||
available.
|
available.
|
||||||
"""
|
"""
|
||||||
|
@ -44,8 +44,8 @@ class LogContextScopeManager(ScopeManager):
|
||||||
span (Span): the span that should become active.
|
span (Span): the span that should become active.
|
||||||
finish_on_close (Boolean): whether Span should be automatically
|
finish_on_close (Boolean): whether Span should be automatically
|
||||||
finished when Scope.close() is called.
|
finished when Scope.close() is called.
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
Scope to control the end of the active period for
|
Scope to control the end of the active period for
|
||||||
*span*. It is a programming error to neglect to call
|
*span*. It is a programming error to neglect to call
|
||||||
Scope.close() on the returned instance.
|
Scope.close() on the returned instance.
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import opentracing
|
import opentracing
|
||||||
from opentracing.propagation import Format
|
from opentracing.propagation import Format
|
||||||
|
|
||||||
from .logcontext import LoggingContext
|
|
||||||
|
|
||||||
|
|
||||||
def extract_span_context(headers):
|
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
|
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
|
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
|
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
|
https://github.com/jaegertracing/jaeger-client-python/blob/master/jaeger_client/constants.py
|
||||||
"""
|
"""
|
||||||
carrier = {}
|
carrier = {}
|
||||||
|
|
Loading…
Reference in New Issue