一个支持statsd exporter兼容标记的pystatsd叉包。
statsd-exporter的Python项目详细描述
=========================================================== python statsd客户端,支持prom/statsd exporter兼容的标记
这是statsd-telegraf
的fork,它是pystatsd
包的fork。
斯塔兹是石墨的友好前端。这是一个python客户端 对于statsd守护进程。更具体地说,这是jsocol的一个分支 pystatsd客户机,增加了对dogtag兼容的支持 标签。
:代码:https://github.com/openmotics/statsd-exporter :license:mit;请参阅许可文件 :问题:https://github.com/openmotics/statsd-exporter/issues
快速使用:
。代码块::python
>>> import statsd
>>> c = statsd.StatsClient('localhost', 8125)
>>> c.incr('foo') # Increment the 'foo' counter.
>>> c.timing('stats.timed', 320) # Record a 320ms 'stats.timed'.
您还可以在所有统计信息中添加前缀:
。代码块::python
>>> import statsd
>>> c = statsd.StatsClient('localhost', 8125, prefix='foo')
>>> c.incr('bar') # Will be 'foo.bar' in statsd/graphite.
支持与数据狗兼容的标记:
。代码块::python
>>> import statsd
>>> c = statsd.StatsClient('localhost', 8125)
>>> c.incr('baz', tags={'type': 'response'})
>>> # baz,type=response:1|c
安装
安装statsd最简单的方法是使用pip!
您可以从pypi安装::
$ pip install statsd-exporter
或github::
$ pip install -e git+https://github.com/openmotics/statsd-exporter#egg=statsd-exporter
或来源:
$ git clone https://github.com/openmotics/statsd-exporter
$ cd statsd-exporter
$ python setup.py install