diff --git a/restreamer/restreamer/main.py b/restreamer/restreamer/main.py index bef5c72..a3784a8 100644 --- a/restreamer/restreamer/main.py +++ b/restreamer/restreamer/main.py @@ -86,6 +86,13 @@ def metrics(): """Return current metrics in prometheus metrics format""" return prom.generate_latest() +# To make nginx proxying simpler, we want to allow /metrics/* to work +@app.route('/metrics/') +@request_stats +def metrics_with_trailing(trailing): + """Expose Prometheus metrics.""" + return prometheus_client.generate_latest() + @app.route('/files') @request_stats def list_channels(): diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index 34be873..f099c26 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -90,6 +90,13 @@ def authenticate(f): def test(editor=None): return json.dumps(editor) +# To make nginx proxying simpler, we want to allow /metrics/* to work +@app.route('/metrics/') +@request_stats +def metrics_with_trailing(trailing): + """Expose Prometheus metrics.""" + return prometheus_client.generate_latest() + @app.route('/metrics') @request_stats def metrics():