Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 7fcffa3

Browse files
committed
Blow up config if opentracing is missing (#5985)
2 parents 9b9dfc2 + a8251da commit 7fcffa3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

changelog.d/5985.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Check at setup that opentracing is installed if it's enabled in the config.

synapse/config/tracer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
from synapse.python_dependencies import DependencyException, check_requirements
17+
1618
from ._base import Config, ConfigError
1719

1820

@@ -32,6 +34,11 @@ def read_config(self, config, **kwargs):
3234
if not self.opentracer_enabled:
3335
return
3436

37+
try:
38+
check_requirements("opentracing")
39+
except DependencyException as e:
40+
raise ConfigError(e.message)
41+
3542
# The tracer is enabled so sanitize the config
3643

3744
self.opentracer_whitelist = opentracing_config.get("homeserver_whitelist", [])

0 commit comments

Comments
 (0)