You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added ASGI application
* Factor out common-functionality for asgi/wsgi
* Convert twisted to use WSGIResource
* Change default HTTP Server to WSGI Server
Signed-off-by: Emil Madsen <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -306,6 +306,19 @@ from prometheus_client import start_wsgi_server
306
306
start_wsgi_server(8000)
307
307
```
308
308
309
+
#### ASGI
310
+
311
+
To use Prometheus with [ASGI](http://asgi.readthedocs.org/en/latest/), there is
312
+
`make_asgi_app` which creates an ASGI application.
313
+
314
+
```python
315
+
from prometheus_client import make_asgi_app
316
+
317
+
app = make_asgi_app()
318
+
```
319
+
Such an application can be useful when integrating Prometheus metrics with ASGI
320
+
apps.
321
+
309
322
#### Flask
310
323
311
324
To use Prometheus with [Flask](http://flask.pocoo.org/) we need to serve metrics through a Prometheus WSGI application. This can be achieved using [Flask's application dispatching](http://flask.pocoo.org/docs/latest/patterns/appdispatch/). Below is a working example.
0 commit comments