From 407fc8be77471651be9b4c11f80bc494f59ff7b9 Mon Sep 17 00:00:00 2001 From: Cyber Oliveira Date: Tue, 30 Jun 2020 12:00:49 -0300 Subject: [PATCH] Update README.md Simplifies Flask example that wraps the app object with prometheus_client's middleware. Signed-off-by: Cyber Oliveira --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e4a8bb0..5630d769 100644 --- a/README.md +++ b/README.md @@ -334,7 +334,7 @@ from prometheus_client import make_wsgi_app app = Flask(__name__) # Add prometheus wsgi middleware to route /metrics requests -app_dispatch = DispatcherMiddleware(app, { +app.wsgi_app = DispatcherMiddleware(app.wsgi_app, { '/metrics': make_wsgi_app() }) ``` @@ -344,7 +344,7 @@ Run the example web application like this ```bash # Install uwsgi if you do not have it pip install uwsgi -uwsgi --http 127.0.0.1:8000 --wsgi-file myapp.py --callable app_dispatch +uwsgi --http 127.0.0.1:8000 --wsgi-file myapp.py --callable app ``` Visit http://localhost:8000/metrics to see the metrics