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

Commit

Permalink
Blow up config if opentracing is missing (#5985)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 25, 2020
2 parents 9b9dfc2 + a8251da commit 7fcffa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/5985.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check at setup that opentracing is installed if it's enabled in the config.
7 changes: 7 additions & 0 deletions synapse/config/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -32,6 +34,11 @@ def read_config(self, config, **kwargs):
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", [])
Expand Down

0 comments on commit 7fcffa3

Please sign in to comment.