##// END OF EJS Templates
statsd: use safe mode and disable statsd if we can't connect
super-admin -
r4886:fa422141 default
parent child Browse files
Show More
@@ -38,8 +38,14 b' def client_from_config(configuration, pr'
38 ipv6 = asbool(_config.pop('statsd_ipv6', IPV6))
38 ipv6 = asbool(_config.pop('statsd_ipv6', IPV6))
39 log.debug('configured statsd client %s:%s', host, port)
39 log.debug('configured statsd client %s:%s', host, port)
40
40
41 return StatsClient(
41 try:
42 client = StatsClient(
42 host=host, port=port, prefix=prefix, maxudpsize=maxudpsize, ipv6=ipv6)
43 host=host, port=port, prefix=prefix, maxudpsize=maxudpsize, ipv6=ipv6)
44 except Exception:
45 log.exception('StatsD is enabled, but failed to connect to statsd server, fallback: disable statsd')
46 client = None
47
48 return client
43
49
44
50
45 def get_statsd_client(request):
51 def get_statsd_client(request):
General Comments 0
You need to be logged in to leave comments. Login now