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

Blow up config if opentracing is missing #5985

Merged
merged 6 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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