Pystatsd
Python implementation of the Statsd client/server
Install / Use
/learn @sivy/PystatsdREADME
Introduction
pystatsd is a client and server implementation of Etsy's brilliant statsd server, a front end/proxy for the Graphite stats collection and graphing server.
- Graphite
- http://graphite.wikidot.com
- Statsd
- code: https://github.com/etsy/statsd
- blog post: http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/
pystatsd is tested on Python 2.7 and 3.8.
Status
Reviewing and merging pull requests, bringing stuff up to date, with tests!
Usage
See statsd_test for sample usage:
from pystatsd import Client, Server
srvr = Server(debug=True)
srvr.serve()
sc = Client('example.org',8125)
sc.timing('python_test.time',500)
sc.increment('python_test.inc_int') # or sc.incr()
sc.decrement('python_test.decr_int') # or sc.decr()
sc.gauge('python_test.gauge', 42)
Building a Debian Package
To build a debian package, run dpkg-buildpackage -rfakeroot
Upstart init Script
Upstart is the daemon management system for Ubuntu.
A basic upstart script has been included for the pystatsd server. It's located under init/, and will be installed to /usr/share/doc if you build/install a .deb file. The upstart script should be copied to /etc/init/pystatsd.conf and will read configuration variables from /etc/default/pystatsd. By default the pystatsd daemon runs as user 'nobody' which is a good thing from a security perspective.
Troubleshooting
You can see the raw values received by pystatsd by packet sniffing:
$ sudo ngrep -qd any . udp dst port 8125
You can see the raw values dispatched to carbon by packet sniffing:
$ sudo ngrep -qd any stats tcp dst port 2003
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
