Add enable_statsd_middleware option so that backend execution timing can be sent to statsd without enabling web request timing.

This commit is contained in:
Nate Coraor
2026-04-24 13:25:01 -04:00
parent 00a9edac82
commit d6329175b6
4 changed files with 33 additions and 1 deletions
+14
View File
@@ -3325,6 +3325,20 @@
:Type: str
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``enable_statsd_middleware``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Description:
Default is true if statsd_host is set. Enable the statsd
middleware. If false and statsd_host is also set, only timing of
certain performance-critical backend tasks (e.g. the job handler
monitor loop time) data will be sent to statsd, but not web
request timing.
:Default: ``false``
:Type: bool
~~~~~~~~~~~~~~~
``statsd_host``
~~~~~~~~~~~~~~~
@@ -1922,6 +1922,12 @@ galaxy:
# self-signed certificate.
#sentry_ca_certs: null
# Default is true if statsd_host is set. Enable the statsd middleware.
# If false and statsd_host is also set, only timing of certain
# performance-critical backend tasks (e.g. the job handler monitor
# loop time) data will be sent to statsd, but not web request timing.
#enable_statsd_middleware: false
# Log to statsd Statsd is an external statistics aggregator
# (https://github.com/etsy/statsd) Enabling the following options will
# cause galaxy to log request timing and other statistics to the
@@ -2448,6 +2448,17 @@ mapping:
Use this option to provide the path to location of the CA (Certificate Authority)
certificate file if the sentry server uses a self-signed certificate.
enable_statsd_middleware:
type: bool
default: false
required: false
desc: |
Default is true if statsd_host is set.
Enable the statsd middleware. If false and statsd_host is also set,
only timing of certain performance-critical backend tasks (e.g. the
job handler monitor loop time) data will be sent to statsd, but not
web request timing.
statsd_host:
type: str
required: false
+2 -1
View File
@@ -1023,7 +1023,8 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
# other middleware):
app = wrap_if_allowed(app, stack, httpexceptions.make_middleware, name="paste.httpexceptions", args=(conf,))
# Statsd request timing and profiling
if statsd_host := conf.get("statsd_host", None):
statsd_host = conf.get("statsd_host", None)
if statsd_host and conf.get("enable_statsd_middleware", statsd_host is not None):
from galaxy.web.framework.middleware.statsd import StatsdMiddleware
app = wrap_if_allowed(