Permalink
Browse files

Document statsd_* commands.

  • Loading branch information...
1 parent 43d1eba commit f0b9468ea3314c13621e0553b75e118caf224e9a @berkerpeksag berkerpeksag committed Dec 1, 2014
Showing with 52 additions and 33 deletions.
  1. +0 −29 README.rst
  2. +1 −0 docs/source/index.rst
  3. +37 −0 docs/source/instrumentation.rst
  4. +7 −2 docs/source/settings.rst
  5. +7 −2 gunicorn/config.py
View
@@ -45,35 +45,6 @@ Example with test app::
$ gunicorn --workers=2 test:app
-Instrumentation
----------------
-
-Gunicorn provides an optional instrumentation of the arbiter and
-workers using the statsD_ protocol over UDP. Thanks to the
-`gunicorn.instrument.statsd` module, Gunicorn becomes a statsD client
-The use of UDP cleanly isolates Gunicorn from the receiving end of the statsD
-metrics so that instrumentation does not cause Gunicorn to be held up by a slow
-statsD consumer.
-
-To use statsD, just tell gunicorn where the statsD server is:
-
- $ gunicorn --statsd-host=localhost:8125 ...
-
-The `Statsd` logger overrides `gunicorn.glogging.Logger` to track
-all requests. The following metrics are generated:
-
- * ``gunicorn.requests``: request rate per second
- * ``gunicorn.request.duration``: histogram of request duration (in millisecond)
- * ``gunicorn.workers``: number of workers managed by the arbiter (gauge)
- * ``gunicorn.log.critical``: rate of critical log messages
- * ``gunicorn.log.error``: rate of error log messages
- * ``gunicorn.log.warning``: rate of warning log messages
- * ``gunicorn.log.exception``: rate of exceptional log messages
-
-To generate new metrics you can `log.info` with a few additional keywords::
-
- log.info("...", extra={"metric": "my.metric", "value": "1.2", "mtype": "gauge"})
-
License
-------
@@ -40,6 +40,7 @@ Contents
run
configure
settings
+ instrumentation
deploy
design
signals
@@ -0,0 +1,37 @@
+.. _instrumentation:
+
+===============
+Instrumentation
+===============
+
+.. versionadded:: 19.1
+
+Gunicorn provides an optional instrumentation of the arbiter and
+workers using the statsD_ protocol over UDP. Thanks to the
+``gunicorn.instrument.statsd`` module, Gunicorn becomes a statsD client
+The use of UDP cleanly isolates Gunicorn from the receiving end of the statsD
+metrics so that instrumentation does not cause Gunicorn to be held up by a slow
+statsD consumer.
+
+To use statsD, just tell gunicorn where the statsD server is:
+
+.. code-block:: bash
+
+ $ gunicorn --statsd-host=localhost:8125 ...
+
+The ``Statsd`` logger overrides ``gunicorn.glogging.Logger`` to track
+all requests. The following metrics are generated:
+
+* ``gunicorn.requests``: request rate per second
+* ``gunicorn.request.duration``: histogram of request duration (in millisecond)
+* ``gunicorn.workers``: number of workers managed by the arbiter (gauge)
+* ``gunicorn.log.critical``: rate of critical log messages
+* ``gunicorn.log.error``: rate of error log messages
+* ``gunicorn.log.warning``: rate of warning log messages
+* ``gunicorn.log.exception``: rate of exceptional log messages
+
+To generate new metrics you can ``log.info`` with a few additional keywords::
+
+ log.info("...", extra={"metric": "my.metric", "value": "1.2", "mtype": "gauge"})
+
+.. _statsD: http://github.com/etsy/statsd
@@ -956,13 +956,18 @@ statsd_host
* ``--statsd-host STATSD_ADDR``
* ``None``
-host:port of the statsd server to log to
+``host:port`` of the statsd server to log to.
+
+.. versionadded:: 19.1
statsd_prefix
~~~~~~~~~~~~~
* ``--statsd-prefix STATSD_PREFIX``
* ````
-Prefix to use when emitting statsd metrics (a trailing . is added, if not provided)
+Prefix to use when emitting statsd metrics (a trailing ``.`` is added,
+if not provided).
+
+.. versionadded:: 19.2
View
@@ -1669,7 +1669,9 @@ class StatsdHost(Setting):
default = None
validator = validate_hostport
desc = """\
- host:port of the statsd server to log to
+ ``host:port`` of the statsd server to log to.
+
+ .. versionadded:: 19.1
"""
class StatsdPrefix(Setting):
@@ -1680,5 +1682,8 @@ class StatsdPrefix(Setting):
default = ""
validator = validate_string
desc = """\
- Prefix to use when emitting statsd metrics (a trailing . is added, if not provided)
+ Prefix to use when emitting statsd metrics (a trailing ``.`` is added,
+ if not provided).
+
+ .. versionadded:: 19.2
"""

0 comments on commit f0b9468

Please sign in to comment.