Statsd Logging¶
Hypercorn can optionally log metrics using the StatsD or DogStatsD protocols. The metrics logged are,
hypercorn.requests: rate of requestshypercorn.request.duration: request duration in millisecondshypercorn.request.status.[#code]: rate of responses by status codehypercorn.log.critical: rate of critical log messageshypercorn.log.error: rate of error log messageshypercorn.log.warning: rate of warning log messageshypercorn.log.exception: rate of exceptional log messages
Usage¶
Setting the config statsd_host to [host]:[port] will result in
these metrics being set to that host, port combination. The config
statsd_prefix can be used to prefix all metrics and
dogstatsd_tags can be used to add tags to each metric.
Customising the statsd logger¶
The statsd logger class can be customised by calling
set_statsd_logger_class method of the Config class. This is
only possible when using the python based configuration file. The
hypercorn.statsd.StatsdLogger class is used by default.