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
* Blow up config if opentracing is missing
  • Loading branch information
JorikSchellekens committed Sep 12, 2019
1 parent f1b4069 commit a8251da
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 a8251da

Please sign in to comment.