summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorik Schellekens <joriksch@gmail.com>2019-09-12 10:57:37 +0100
committerGitHub <noreply@github.com>2019-09-12 10:57:37 +0100
commita8251da10f98a251b9aa0be1f313d8d2e4ac1c3f (patch)
tree330468b0eefc4d780b7c6fbd5b344055c32422ca
parentMerge pull request #6020 from matrix-org/jaywink/allow-support-users-to-register (diff)
downloadsynapse-a8251da10f98a251b9aa0be1f313d8d2e4ac1c3f.tar.xz
Blow up config if opentracing is missing (#5985)
* Blow up config if opentracing is missing
-rw-r--r--changelog.d/5985.feature1
-rw-r--r--synapse/config/tracer.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/changelog.d/5985.feature b/changelog.d/5985.feature
new file mode 100644
index 0000000000..e5e29504af
--- /dev/null
+++ b/changelog.d/5985.feature
@@ -0,0 +1 @@
+Check at setup that opentracing is installed if it's enabled in the config.
diff --git a/synapse/config/tracer.py b/synapse/config/tracer.py
index 95e7ccb3a3..85d99a3166 100644
--- a/synapse/config/tracer.py
+++ b/synapse/config/tracer.py
@@ -13,6 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from synapse.python_dependencies import DependencyException, check_requirements
+
 from ._base import Config, ConfigError
 
 
@@ -32,6 +34,11 @@ class TracerConfig(Config):
         if not self.opentracer_enabled:
             return
 
+        try:
+            check_requirements("opentracing")
+        except DependencyException as e:
+            raise ConfigError(e.message)
+
         # The tracer is enabled so sanitize the config
 
         self.opentracer_whitelist = opentracing_config.get("homeserver_whitelist", [])