Skip to main content

A common WSGI stack

Project description

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 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 gunicorn’s, 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 (and optionally, prometheus_client)

  • sentry for errors

  • werkzeug for thread locals and wsgi utilities

It also supports additionaly optional tools:

  • celery for async tasks

  • prometheus as an alternate metrics tool

It’s main job is to integrate and configure all the above in a single tool, for use in both dev and production, which provides a standard set of features out of the box:

  • drop-in replacement for gunicorn as a wsgi runner

  • standardised structured logging on top of python stdlib logging

  • request id tracing

  • standard set of status endpoints for your app

  • easier configuration via env vars

  • metrics for everything

  • deep sentry integration (WIP)

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:

  • add structured logging tags to your application logs

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

  • per-thread requests connection pool management

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

  • grok filters for log parsing

  • 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

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.9.5.tar.gz (22.2 kB view details)

Uploaded Source

Built Distributions

talisker-0.9.5-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

talisker-0.9.5-py2-none-any.whl (39.3 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for talisker-0.9.5.tar.gz
Algorithm Hash digest
SHA256 adfb5c08360cf557d47382c9c6ed78e349c23443dde8977791229f227f78e3f0
MD5 fdd902a6c5e1dfa352e7ac67bb27a122
BLAKE2b-256 b2baeae9a299c53175739f15a989214aab65e0c0f3eb0248fa43e0e9dfea0f3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for talisker-0.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 df1420455243d126768c52f526c252038fef65f8bc70766a4523a752dfceaca7
MD5 0766cf0c98025a0d2193d53fbad4ea2f
BLAKE2b-256 defe2e88d97edb125026b747ed548831b11f7cfc22d304293c2596375585d3b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for talisker-0.9.5-py2-none-any.whl
Algorithm Hash digest
SHA256 44ffc75fbc4592e60cd6a8dcb534f1377fc4808e91a9d8671b98bf7f9c9cc511
MD5 a1cefc6f0da7b9e9d20811735bf4f244
BLAKE2b-256 0e3aa5255997b1134f60b1bfd45d063eeef8a02b63ecc5b0cc2e8a17cdae7881

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