Skip to main content

A common WSGI stack

Project description

Talisker - an opinionated WSGI app platform

https://img.shields.io/pypi/v/talisker.svg https://img.shields.io/travis/canonical-ols/talisker.svg Documentation Status

Talisker is a runtime for your wsgi app that aims to provide a common platform for your python services.

tl;dr

Simply run your wsgi app with talisker as if it was gunicorn.:

talisker app:wsgi -c config.py …

Talisker will wrap your app in a some simple WSGI middleware, and configure logging to output structured logging like so:

logger = logging.getLogger('app')
logger.info('something happened', extra={'context': 'I haz it'})

will output:

2016-01-13 10:24:07.357Z INFO app "something happened" svc.context="I can haz it" request_id=...

It also exposes some status endpoints you can use, go to the /_status/ url on your app to see them.

This all works out of the box by using the talisker runner instead of gunicorns, and there are many more features you can use too.

Elevator Pitch

Talisker is based on a number of standard python tools:

  • stdlib logging for logs

  • gunicorn for a wsgi runner

  • requests for http requests

  • statsd for metrics

  • raven for errors

  • werkzeug for thread locals and wsgi utilities

It is designed sepcifically to be used in both development and production, and aims to provide a default set of features out of the box:

  • standard log format, including ISO/UTC timestamps

  • structured logging with python stdlib

  • improved gunicorn access logs, with ms precision UTC timestamps

  • request id tracing

  • standard set of status endpoints for your app

  • easier statsd endpoint configuration

  • sentry/raven middleware (TODO)

All the above are available by just using the talisker entry point script, rather than gunicorn.

In addition, with a small amount of effort, your app can benefit from additional features:

  • simple deeper nagios checks - just implement a _status/check url in your app

  • per-thread requests connection pool managment (WIP)

  • automatic statsd metrics for outgoing HTTP requests (WIP)

  • more efficient statsd client management (WIP)

Additionally, talisker provides additional tools for integrating with your infrastructure:

  • grok filters for log parsing (WIP)

  • rsyslog templates and config for log shipping (TODO)

Talisker is opinionated, and derived directly from the authors’ needs and as such not currently very configurable. However, PR’s are very welcome!

For more information, see The Documentation, which should be found at:

https://talisker.readthedocs.io

History

0.5.0 (2016-08-10)

  • add grok filters for logstash

  • slight adjustment to logfmt serialisation: talisker now strips “ from tag values. This is due to a limitation in logstash.

0.4.1 (2016-08-05)

  • publish separate py2/py3 wheels, due to dependency differences

  • some doc changes

0.4.0 (2016-08-05)

  • First public release an PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

talisker-0.5.4.tar.gz (50.7 kB view details)

Uploaded Source

Built Distributions

talisker-0.5.4-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

talisker-0.5.4-py2-none-any.whl (23.3 kB view details)

Uploaded Python 2

File details

Details for the file talisker-0.5.4.tar.gz.

File metadata

  • Download URL: talisker-0.5.4.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for talisker-0.5.4.tar.gz
Algorithm Hash digest
SHA256 7c07373b51ca24d65ec2447b210d758ff81e600a780045c1578522ff2d3ec68e
MD5 28f33de389825ddc017207454c6620b9
BLAKE2b-256 4d649327db98ba60c95a7ee4134baff5fbdf44848fadd1b7888ab36ce91cc064

See more details on using hashes here.

File details

Details for the file talisker-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for talisker-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 05ff41194bc19e00e963487c4dfdb0fe4009905e6cacbb5b778cc82ac8a09ebf
MD5 0067fa5edada021ed64b500bceb0cca5
BLAKE2b-256 cd21f7135b73d4ef83cd13531c16192db141925079a2e261886c623d3348074a

See more details on using hashes here.

File details

Details for the file talisker-0.5.4-py2-none-any.whl.

File metadata

File hashes

Hashes for talisker-0.5.4-py2-none-any.whl
Algorithm Hash digest
SHA256 6f80fcd474b92aa2a1cf6fcaf655f5ab7e40ee7085263fd66d1fa202e0cca0d2
MD5 9884f2cc9c3e8bb77f6cd7f3adc32e8a
BLAKE2b-256 5f40da553ea8aa24fa211139dae3a90fdfeaca5963120b12c8a8f6663bdc6987

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page