From c5bf627035e270f975e2f4c839ed597d2fc4b3e5 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 2 Jun 2021 16:29:22 +0100 Subject: [PATCH 1/2] Enable Prometheus metrics for the jaeger client library --- changelog.d/10112.misc | 1 + synapse/logging/opentracing.py | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 changelog.d/10112.misc diff --git a/changelog.d/10112.misc b/changelog.d/10112.misc new file mode 100644 index 000000000000..40af09760c7e --- /dev/null +++ b/changelog.d/10112.misc @@ -0,0 +1 @@ +Enable Prometheus metrics for the jaeger client library. diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py index f64845b80cc0..05b7d262cd90 100644 --- a/synapse/logging/opentracing.py +++ b/synapse/logging/opentracing.py @@ -356,10 +356,13 @@ def init_tracer(hs: "HomeServer"): set_homeserver_whitelist(hs.config.opentracer_whitelist) + from jaeger_client.metrics.prometheus import PrometheusMetricsFactory + config = JaegerConfig( config=hs.config.jaeger_config, service_name="{} {}".format(hs.config.server_name, hs.get_instance_name()), scope_manager=LogContextScopeManager(hs.config), + metrics_factory=PrometheusMetricsFactory(), ) # If we have the rust jaeger reporter available let's use that. From 770b77218797b8cad751f61b8dbb870347519a17 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 3 Jun 2021 16:26:39 +0100 Subject: [PATCH 2/2] mypy: ignore subpackages of `jaeger_client`. --- mypy.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index 062872020e4c..8ba1b9631121 100644 --- a/mypy.ini +++ b/mypy.ini @@ -130,7 +130,7 @@ ignore_missing_imports = True [mypy-canonicaljson] ignore_missing_imports = True -[mypy-jaeger_client] +[mypy-jaeger_client.*] ignore_missing_imports = True [mypy-jsonschema]