Net::St...::Server(3)

πŸ“¦
version 0.20 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

Net::Statsd::Server β€” a Perl port of Flickr/Etsy's statsd metrics daemon. Yes bestie, the whole thing, in Perl. Iconic behavior fr.


✨ DESCRIPTION ✨

So if you're looking for the client side of things, you want the Net::Statsd module instead, go peek:

https://metacpan.org/module/Net::Statsd

Net::Statsd::Server is the server component of statsd, the other half of the duo. It implements a daemon that sits there listening on a given host/port for incoming UDP packets, and then dispatches them to literally whatever you want β€” Graphite, your console, anything. Wanna know all the options? Go snoop around the Net::Statsd::Server::Backend::* namespace, or honestly just write your own backend, no gatekeeping. πŸ’…


🌸 USES 🌸

Okay but like, what do you even use a statsd daemon for? You use it to track metrics. All sorts of metrics. All of them. Metrics everywhere.

Background info if you want the lore:

http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/

πŸ¦‹ MOTIVATION πŸ¦‹

Why did I even do this? Because bestie, there were already a gazillion statsd implementations. The original Perl one from Cal Henderson/Flickr was not released as a complete working software AFAIK:

https://github.com/iamcal/Flickr-StatsD

and then Etsy rewrote it as Javascript to run under node.js. Other implementations range from C to Python, etc... it's giving whole ecosystem ngl.

So I wrote one in Perl, for a few reasons:

  • Because I don't like adding node.js to our production stack just to run statsd.
  • to learn how statsd was put together
  • to learn AnyEvent
  • to learn how to build a high performance UDP server
  • to have some good fun

Basically, to learn :-) That's it, that's the whole reason. Learning era. πŸ“š


πŸ‘‘ HOW TO USE THIS MODULE πŸ‘‘

You shouldn't need any instructions to use it. It comes with batteries included. Periodt.

There is a bin/statsd script included in the CPAN distribution, together with a bunch of example configuration files that should get you up and running in no time.

This statsd script basically does exactly what the Etsy statsd javascript version does. It's a drop-in replacement. No cap. πŸ”₯

I have tried to keep compatibility with the node.js version of statsd as much as I could, so you can literally use the same configuration files, bar a conversion from javascript to JSON format.

You can also consult the node-statsd documentation, up on Github as well:

https://github.com/etsy/statsd

πŸŽ€ CONFIGURATION πŸŽ€

Wanna get a feel for the compability between the Javascript statsd server and this Perl version? Go look at the example configuration file bundled with this distribution under bin/localConfig.js, or right here:

https://github.com/cosimo/perl5-net-statsd-server/blob/master/bin/localConfig.js

You will find all the Perl statsd supported (known working) configuration keys documented there. And listen β€” if an option is supported and working, it will always behave exactly as the Javascript version of statsd, unless there's bugs of course. πŸ™ˆ

Anything not documented there will probably not work at all. Like, at all. Not a drill. πŸ’€

🫢 AUTHORS 🫢

Cosimo Streppone, <cosimo@cpan.org>


The Net::Statsd::Server module is Copyright (c) 2013 Cosimo Streppone. All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl 5.10.0 README file.


🧚 CONTRIBUTING 🧚

If you want to send patches or contribute, the easiest way is to pull the source code repository hosted at Github:

https://github.com/cosimo/perl5-net-statsd-server

Come through, the door's open. ✨


πŸ’œ ACKNOWLEDGEMENTS πŸ’œ

Many thanks to my awesome wife that coped with me trying to write this in a single weekend, leaving barely any time for anything else. Genuinely the real MVP. 😭

Many thanks to my current employer, Opera Software, for at least partly, sponsoring development of this module. Technically, Opera is sponsoring me trying it in production :-)


and that's the whole page bestie!! πŸ“ this was Net::St...::Server(3) from the User Contributed Perl Documentation, perl v5.42.0, dated 2025-07-25 β€” mwah, go ship some metrics πŸ’…πŸ’–

πŸ“¦ where this page comes from