8000 Update README.md (#563) · lweith/client_python@5b0a476 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b0a476

Browse files
author
Cyber Oliveira
authored
Update README.md (prometheus#563)
Simplifies Flask example that wraps the app object with prometheus_client's middleware. Signed-off-by: Cyber Oliveira <lccro@msn.com>
1 parent dd93abe commit 5b0a476

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ from prometheus_client import make_wsgi_app
334334
app = Flask(__name__)
335335

336336
# Add prometheus wsgi middleware to route /metrics requests
337-
app_dispatch = DispatcherMiddleware(app, {
337+
app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {
338338
'/metrics': make_wsgi_app()
339339
})
340340
```
@@ -344,7 +344,7 @@ Run the example web application like this
344344
```bash
345345
# Install uwsgi if you do not have it
346346
pip install uwsgi
347-
uwsgi --http 127.0.0.1:8000 --wsgi-file myapp.py --callable app_dispatch
347+
uwsgi --http 127.0.0.1:8000 --wsgi-file myapp.py --callable app
348348
```
349349

350350
Visit http://localhost:8000/metrics to see the metrics

0 commit comments

Comments
 (0)
0