Skip to content

Commit c6dc983

Browse files
authored
Add instructions for WSGI Tornado support
1 parent 684e003 commit c6dc983

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

INSTALLATION.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,29 @@ app = iWSGIMiddleware(app)
113113

114114
Then booting your stack with `gunicorn myfalcon:app` as an example
115115

116+
## Tornado WSGI
117+
118+
You can have request visbility in Tornado by adding the Instana WSGI to your application:
119+
120+
```python
121+
import tornado.web
122+
import tornado.wsgi
123+
import wsgiref.simple_server
124+
from instana.wsgi import iWSGIMiddleware
125+
126+
class MainHandler(tornado.web.RequestHandler):
127+
def get(self):
128+
self.write("Hello, world")
129+
130+
if __name__ == "__main__":
131+
application = tornado.web.Application([
132+
(r"/", MainHandler),
133+
])
134+
wsgi_app = iWSGIMiddleware(tornado.wsgi.WSGIAdapter(application))
135+
server = wsgiref.simple_server.make_server('', 8888, wsgi_app)
136+
server.serve_forever()
137+
```
138+
116139
# uWSGI Webserver
117140

118141
tldr; Make sure `enable-threads` and `lazy-apps` is enabled for uwsgi.

0 commit comments

Comments
 (0)