diff --git a/lib/galaxy/web/framework/middleware/statsd.py b/lib/galaxy/web/framework/middleware/statsd.py index 1b017f71565..d817569f3d8 100644 --- a/lib/galaxy/web/framework/middleware/statsd.py +++ b/lib/galaxy/web/framework/middleware/statsd.py @@ -28,8 +28,13 @@ class StatsdMiddleware: start_time = time.time() req = self.application(environ, start_response) dt = int((time.time() - start_time) * 1000) - page = environ.get("controller_action_key", None) or environ.get("PATH_INFO", "NOPATH").strip("/").replace( - "/", "." + page = ( + environ.get("controller_action_key", None) + or environ.get("PATH_INFO", "NOPATH") + .strip("/") + .replace("/", ".") + .encode("ascii", errors="replace") + .decode() ) self.galaxy_stasd_client.timing(page, dt) try: