diff --git a/vcsserver/lib/_vendor/statsd/__init__.py b/vcsserver/lib/_vendor/statsd/__init__.py --- a/vcsserver/lib/_vendor/statsd/__init__.py +++ b/vcsserver/lib/_vendor/statsd/__init__.py @@ -38,8 +38,14 @@ def client_from_config(configuration, pr ipv6 = asbool(_config.pop('statsd_ipv6', IPV6)) log.debug('configured statsd client %s:%s', host, port) - return StatsClient( - host=host, port=port, prefix=prefix, maxudpsize=maxudpsize, ipv6=ipv6) + try: + client = StatsClient( + host=host, port=port, prefix=prefix, maxudpsize=maxudpsize, ipv6=ipv6) + except Exception: + log.exception('StatsD is enabled, but failed to connect to statsd server, fallback: disable statsd') + client = None + + return client def get_statsd_client(request):