Configuration¶
Talisker can be configured by the environment variables listed below. These variables can also be supplied in a python file, although environment variables override any file configuration.
TALISKER_CONFIG¶
A path to a python file containing configuration variables.
Note: this will only have effect when set via environment variable, for obvious reasons.
DEVEL¶
Allows coloured logs, warnings, and other development convieniences.
DEVEL mode enables coloured log output, enables python warnings and, for gunicorn, it sets longer timeouts and auto reloads by default.
TALISKER_COLOUR¶
Controls the coloured output of logs. Defaults to on if stdin is a tty. Can be set to: 0 (off), 1 (on), or ‘simple’ for a simpler colourscheme. Requires DEVEL mode to be enabled.
Can also be disabled with TERM=dumb env var.
DEBUGLOG¶
Path to write debug level logs to, which is enabled if path is writable.
Debug logs are rotated every 24h to limit size, with only a single 24 hour archive is kept.
TALISKER_SLOWQUERY_THRESHOLD¶
Set the threshold (in ms) over which SQL queries will be logged. Defaults to -1 (off). The queries are sanitised, and thus safe to ship to a log aggregator.
Setting to 0 will log every query, which can be useful in development. The queries are sanitized by not including the bind parameter values.
TALISKER_EXPLAIN_SQL¶
Include EXPLAIN plans in sql sentry breadcrumbs. Defaults to false.
When enabled, this will issue extra queries to the db when generating sentry reports. The EXPLAIN queries will be quick to execute, as it doesn’t actually run the query, but still, caution is advised.
TALISKER_SOFT_REQUEST_TIMEOUT¶
Set the threshold (in ms) over which WSGI requests will report a soft time out to sentry. Defaults to -1 (off).
A soft timeout is simply a warning-level sentry report for the request. The aim is to provide early warning and context for when things exceed some limit.
Note: this can be set on a per-endpoint basis using the talisker.request_timeout decorator.
TALISKER_REQUEST_TIMEOUT¶
Set a deadline for all requests. Any network requests that talisker suports (requests, psycopg2) will have their timeouts set to this deadline.
Note: this can be set on a per-endpoint basis using the talisker.request_timeout decorator.
TALISKER_LOGSTATUS¶
Sets whether http requests to /_status/ endpoints are logged in the access log or not. Defaults to false.
These log lines can add a lot of noise, so they are turned off by default.
TALISKER_NETWORKS¶
Sets additional CIDR networks that are allowed to access restricted /_status/ endpoints. Comma separated list.
This protection is very basic, and can be easily spoofed by X-Forwarded-For headers. You should ensure that your HTTP front end server is configuring these correctly before passing on to gunicorn.
TALISKER_STATUS_INTERFACE¶
Which network interface to respond to /_status requests on.
TALISKER_REVISION_ID¶
Sets the explicit revision of the application. If not set, a best effort detection of VCS revision is used.
This is used to tag sentry reports, as well as returned as a header and from /_status/ping.
The default lookup will try find a version-info.txt file, or git, hg, or bzr revno, and finally a setup.py version.
TALISKER_UNIT¶
Sets the instance name for use with sentry reports.
TALISKER_ENV¶
Sets the deployed environment for use with sentry reports (e.g. production, staging).
TALISKER_DOMAIN¶
Sets the site domain name for use with sentry reports.
STATSD_DSN¶
Sets the Statsd DSN string, in the form: udp://host:port/my.prefix
You can also add the querystring parameter ?maxudpsize=N, to change from the default of 512.
SENTRY_DSN¶
Sets the sentry DSN, as per usual sentry client configuration.
See the sentry DSN documentation for more details.
TALISKER_SANITISE_KEYS¶
Comma separated list of keys with sensitive information. Data in these keys is masked in logging and sentry reports.
Note that sentry’s default set of password keys are already included - this is for extra keys.
TALISKER_ID_HEADER¶
Header containing request id. Defaults to X-Request-Id.
TALISKER_DEADLINE_HEADER¶
Header for request deadline. Defaults to X-Request-Deadline.