pull/5544/head
Jorik Schellekens 2019-06-25 18:36:37 +01:00
parent 34235a45e4
commit 1d591afba4
5 changed files with 8 additions and 20 deletions

View File

@ -1356,7 +1356,7 @@ password_config:
## Opentracing ##
# These settings enable opentracing which implements distributed tracing
# This allows you to observe the causal chain of events across servers
# This allows you to observe the causal chain of events across servers
# including requests, key lookups etc. across any server running
# synapse or any other other services which supports opentracing.
# (specifically those implemented with jaeger)

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
from jaeger_client import Config as JaegerConfig
from synapse.util.scopecontextmanager import LogContextScopeManager
@ -22,8 +20,6 @@ from synapse.util.tracerutils import TracerUtil
from ._base import Config, ConfigError
logger = logging.getLogger(__name__)
class TracerConfig(Config):
def read_config(self, config, **kwargs):
@ -45,7 +41,7 @@ class TracerConfig(Config):
return """\
## Opentracing ##
# These settings enable opentracing which implements distributed tracing
# This allows you to observe the causal chain of events across servers
# This allows you to observe the causal chain of events across servers
# including requests, key lookups etc. across any server running
# synapse or any other other services which supports opentracing.
# (specifically those implemented with jaeger)

View File

@ -23,9 +23,10 @@ from six import PY3, raise_from, string_types
from six.moves import urllib
import attr
import opentracing
import treq
from canonicaljson import encode_canonical_json
from opentracing.propagation import Format
from opentracing import tags
from prometheus_client import Counter
from signedjson.sign import sign_json
from zope.interface import implementer
@ -37,10 +38,6 @@ from twisted.internet.task import _EPSILON, Cooperator
from twisted.web._newclient import ResponseDone
from twisted.web.http_headers import Headers
import opentracing
from opentracing import tags
from synapse.util.tracerutils import TracerUtil
import synapse.metrics
import synapse.util.retryutils
from synapse.api.errors import (
@ -56,6 +53,7 @@ from synapse.http.federation.matrix_federation_agent import MatrixFederationAgen
from synapse.util.async_helpers import timeout_deferred
from synapse.util.logcontext import make_deferred_yieldable
from synapse.util.metrics import Measure
from synapse.util.tracerutils import TracerUtil
logger = logging.getLogger(__name__)

View File

@ -100,7 +100,7 @@ class _LogContextScope(Scope):
manager (LogContextScopeManager):
the manager that is responsible for this scope.
span (Span):
the opentracing span which this scope represents the local
the opentracing span which this scope represents the local
lifetime for.
logcontext (LogContext):
the logcontext to which this scope is attached.

View File

@ -13,15 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.import opentracing
import logging
logger = logging.getLogger(__name__)
import re
import opentracing
from opentracing.propagation import Format
import re
# block everything by default
@ -40,7 +36,6 @@ class TracerUtil:
TracerUtil._homeserver_whitelist = re.compile(
"({})".format(")|(".join(homeserver_whitelist))
)
logger.info("Set whitelist to {}".format(TracerUtil._homeserver_whitelist))
@staticmethod
def whitelisted_homeserver(destination):
@ -94,7 +89,7 @@ class TracerUtil:
@staticmethod
def inject_span_context_byte_dict(headers, span, destination):
"""
Injects a span context into a dict where the headers are encoded as byte
Injects a span context into a dict where the headers are encoded as byte
strings
Args:
@ -112,7 +107,6 @@ class TracerUtil:
https://github.com/jaegertracing/jaeger-client-python/blob/master/jaeger_client/constants.py
"""
if not TracerUtil.whitelisted_homeserver(destination):
logger.info("{}".format(TracerUtil._homeserver_whitelist))
return
carrier = {}