diff --git a/docs/sample_config.yaml b/docs/sample_config.yaml index 6fb9313db3..8976d48ff0 100644 --- a/docs/sample_config.yaml +++ b/docs/sample_config.yaml @@ -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) diff --git a/synapse/config/tracer.py b/synapse/config/tracer.py index 76fa5b8920..3c14196b92 100644 --- a/synapse/config/tracer.py +++ b/synapse/config/tracer.py @@ -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) diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 4bc5ceeeee..8d806c949b 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -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__) diff --git a/synapse/util/scopecontextmanager.py b/synapse/util/scopecontextmanager.py index 6e0acab42e..85a06bf5b4 100644 --- a/synapse/util/scopecontextmanager.py +++ b/synapse/util/scopecontextmanager.py @@ -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. diff --git a/synapse/util/tracerutils.py b/synapse/util/tracerutils.py index e2337d654f..5a2e96e1cb 100644 --- a/synapse/util/tracerutils.py +++ b/synapse/util/tracerutils.py @@ -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 = {}