linting
parent
34235a45e4
commit
1d591afba4
|
@ -13,8 +13,6 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from jaeger_client import Config as JaegerConfig
|
from jaeger_client import Config as JaegerConfig
|
||||||
|
|
||||||
from synapse.util.scopecontextmanager import LogContextScopeManager
|
from synapse.util.scopecontextmanager import LogContextScopeManager
|
||||||
|
@ -22,8 +20,6 @@ from synapse.util.tracerutils import TracerUtil
|
||||||
|
|
||||||
from ._base import Config, ConfigError
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class TracerConfig(Config):
|
class TracerConfig(Config):
|
||||||
def read_config(self, config, **kwargs):
|
def read_config(self, config, **kwargs):
|
||||||
|
|
|
@ -23,9 +23,10 @@ from six import PY3, raise_from, string_types
|
||||||
from six.moves import urllib
|
from six.moves import urllib
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
import opentracing
|
||||||
import treq
|
import treq
|
||||||
from canonicaljson import encode_canonical_json
|
from canonicaljson import encode_canonical_json
|
||||||
from opentracing.propagation import Format
|
from opentracing import tags
|
||||||
from prometheus_client import Counter
|
from prometheus_client import Counter
|
||||||
from signedjson.sign import sign_json
|
from signedjson.sign import sign_json
|
||||||
from zope.interface import implementer
|
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._newclient import ResponseDone
|
||||||
from twisted.web.http_headers import Headers
|
from twisted.web.http_headers import Headers
|
||||||
|
|
||||||
import opentracing
|
|
||||||
from opentracing import tags
|
|
||||||
from synapse.util.tracerutils import TracerUtil
|
|
||||||
|
|
||||||
import synapse.metrics
|
import synapse.metrics
|
||||||
import synapse.util.retryutils
|
import synapse.util.retryutils
|
||||||
from synapse.api.errors import (
|
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.async_helpers import timeout_deferred
|
||||||
from synapse.util.logcontext import make_deferred_yieldable
|
from synapse.util.logcontext import make_deferred_yieldable
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
|
from synapse.util.tracerutils import TracerUtil
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -13,15 +13,11 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.import opentracing
|
# limitations under the License.import opentracing
|
||||||
|
|
||||||
import logging
|
import re
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
import opentracing
|
import opentracing
|
||||||
from opentracing.propagation import Format
|
from opentracing.propagation import Format
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
# block everything by default
|
# block everything by default
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +36,6 @@ class TracerUtil:
|
||||||
TracerUtil._homeserver_whitelist = re.compile(
|
TracerUtil._homeserver_whitelist = re.compile(
|
||||||
"({})".format(")|(".join(homeserver_whitelist))
|
"({})".format(")|(".join(homeserver_whitelist))
|
||||||
)
|
)
|
||||||
logger.info("Set whitelist to {}".format(TracerUtil._homeserver_whitelist))
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def whitelisted_homeserver(destination):
|
def whitelisted_homeserver(destination):
|
||||||
|
@ -112,7 +107,6 @@ class TracerUtil:
|
||||||
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
|
||||||
"""
|
"""
|
||||||
if not TracerUtil.whitelisted_homeserver(destination):
|
if not TracerUtil.whitelisted_homeserver(destination):
|
||||||
logger.info("{}".format(TracerUtil._homeserver_whitelist))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
carrier = {}
|
carrier = {}
|
||||||
|
|
Loading…
Reference in New Issue