mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
Allow specifying statsd host/port/prefix info
Currently only passes it through to CHP. This is needed for the cases when JupyterHub spawns and maintains CHP.
This commit is contained in:
@@ -449,6 +449,20 @@ class JupyterHub(Application):
|
||||
"""
|
||||
).tag(config=True)
|
||||
|
||||
statsd_host = Unicode(
|
||||
help="Host to send statds metrics to"
|
||||
).tag(config=True)
|
||||
|
||||
statsd_port = Int(
|
||||
8125,
|
||||
help="Port on which to send statsd metrics about the hub"
|
||||
).tag(config=True)
|
||||
|
||||
statsd_prefix = Unicode(
|
||||
'jupyterhub',
|
||||
help="Prefix to use for all metrics sent by jupyterhub to statsd"
|
||||
)
|
||||
|
||||
handlers = List()
|
||||
|
||||
_log_formatter_cls = CoroutineLogFormatter
|
||||
@@ -867,6 +881,12 @@ class JupyterHub(Application):
|
||||
cmd.extend(['--ssl-key', self.ssl_key])
|
||||
if self.ssl_cert:
|
||||
cmd.extend(['--ssl-cert', self.ssl_cert])
|
||||
if self.statsd_host:
|
||||
cmd.extend([
|
||||
'--statsd-host', self.statsd_host,
|
||||
'--statsd-port', self.statsd_port,
|
||||
'--statsd-prefix', self.statsd_prefix + '.chp'
|
||||
])
|
||||
# Require SSL to be used or `--no-ssl` to confirm no SSL on
|
||||
if ' --ssl' not in ' '.join(cmd):
|
||||
if self.confirm_no_ssl:
|
||||
|
Reference in New Issue
Block a user