pys

pystatsd

Python implementation of the Statsd client/server

Showing:

Popularity

Downloads/wk

0

GitHub Stars

360

Maintenance

Last Commit

2yrs ago

Contributors

42

Package

Dependencies

0

License

BSD

Categories

Readme

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.

pystatsd is tested on Python 2.7 and 3.8.

Status

Reviewing and merging pull requests, bringing stuff up to date, with tests!

lint_python

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100