mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Special-case the default bind_addresses for metrics listener
turns out it doesn't really support ipv6, so let's hack around that by only listening on ipv4 by default.
This commit is contained in:
parent
19818d66af
commit
e3a0300431
@ -153,9 +153,8 @@ def listen_metrics(bind_addresses, port):
|
|||||||
from prometheus_client import start_http_server
|
from prometheus_client import start_http_server
|
||||||
|
|
||||||
for host in bind_addresses:
|
for host in bind_addresses:
|
||||||
reactor.callInThread(start_http_server, int(port),
|
logger.info("Starting metrics listener on %s:%d", host, port)
|
||||||
addr=host, registry=RegistryProxy)
|
start_http_server(port, addr=host, registry=RegistryProxy)
|
||||||
logger.info("Metrics now reporting on %s:%d", host, port)
|
|
||||||
|
|
||||||
|
|
||||||
def listen_tcp(bind_addresses, port, factory, reactor=reactor, backlog=50):
|
def listen_tcp(bind_addresses, port, factory, reactor=reactor, backlog=50):
|
||||||
|
@ -151,6 +151,10 @@ class ServerConfig(Config):
|
|||||||
|
|
||||||
# if we still have an empty list of addresses, use the default list
|
# if we still have an empty list of addresses, use the default list
|
||||||
if not bind_addresses:
|
if not bind_addresses:
|
||||||
|
if listener['type'] == 'metrics':
|
||||||
|
# the metrics listener doesn't support IPv6
|
||||||
|
bind_addresses.append('0.0.0.0')
|
||||||
|
else:
|
||||||
bind_addresses.extend(DEFAULT_BIND_ADDRESSES)
|
bind_addresses.extend(DEFAULT_BIND_ADDRESSES)
|
||||||
|
|
||||||
self.listeners.append(listener)
|
self.listeners.append(listener)
|
||||||
|
Loading…
Reference in New Issue
Block a user