Skip to content

Instantly share code, notes, and snippets.

@filiphanes
filiphanes / statsd_client.py
Created January 25, 2023 13:32
Simple and fast statsd client in Python 3
import os
import socket
class StatsdClient:
def __init__(self, url=None):
"""url: protocol://host:port/prefix"""
if url is None:
url = os.environ.get('STATSD_URL', 'udp://localhost:8125/')
url = urlparse(url, scheme='udp')
family, _, _, _, self._addr = socket.getaddrinfo(

Keybase proof

I hereby claim:

  • I am filiphanes on github.
  • I am filiphanes (https://keybase.io/filiphanes) on keybase.
  • I have a public key ASASVkIiHPzxcDXGRQ-DiraxnfMe5hOruXgofEX4z6suOQo

To claim this, I am signing this object: