statsd
A simple statsd client.
What it is and what it does
statsd is a lightweight Python client for sending application metrics to a statsd daemon, which typically forwards them to Graphite for storage and visualization. It provides a simple API to increment counters, record timings, and report gauges—the core metric types used in monitoring systems. The library has no runtime dependencies and works across Python 3.7 through 3.11, making it easy to add to existing projects.
You instantiate a StatsClient with a host and port, then call methods like incr(), timing(), and gauge() to emit metrics. The client handles the UDP protocol communication with the daemon. It supports metric prefixing to namespace your stats, and the straightforward API makes it suitable for both simple scripts and large applications that need to feed metrics into a centralized monitoring stack.
Use it for:
- Track request counts and response times in a web application for real-time performance dashboards.
- Monitor background job execution by recording job duration and success/failure counters.
- Measure database query performance by timing queries and reporting slow-query counts.
- Instrument microservices to emit custom business metrics (e.g., user signups, transactions) to a shared monitoring backend.
- Profile batch processing jobs by recording throughput and latency metrics during data pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client library that sends metrics to a statsd daemon, enabling you to track counters, timers, and gauges for monitoring and visualization in Graphite.
Yes. statsd is a mature, zero-dependency client for a widely-used monitoring protocol. It has no known vulnerabilities, permissive licensing, and active maintenance. Install it if you need to send metrics to a statsd/Graphite stack; skip it only if your monitoring backend uses a different protocol (Prometheus, CloudWatch, etc.).
Install
statsd on PyPI
pip
pip install statsduv
uv add statsdpoetry
poetry add statsdInstalling statsd
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is active with recent commits; the package has been stable since its early releases.
License in practice
MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.
Quickstart
pip install statsd
import statsd
c = statsd.StatsClient('localhost', 8125)
c.incr('foo') # Increment counter
c.timing('stats.timed', 320) # Record 320ms timing
A statsd daemon must be running and reachable at the specified host and port (default localhost:8125).
Verify before relying
- Whether the package supports UDP batching or other performance optimizations for high-volume metric submission.
- Current test coverage and CI/CD practices given the long gap since the latest release (2022-11-06).
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,377 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 17,993,050/month — #1,093 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: statsd-4.0.1-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
django-statsd-mozillaProvides Django integration with statsd for…
permissive · top 15,000 on PyPI
python-statsdA client library for sending metrics to Etsy's…
permissive · top 15,000 on PyPI
statsd-tagsA Python client for sending metrics to…
permissive · top 15,000 on PyPI
statshogA Python client for sending metrics to StatsD…
permissive · top 5,000 on PyPI
statsd-pythonA Python client library for sending metrics to…
permissive · top 15,000 on PyPI
graphytegraphyte sends metrics to a Graphite/Carbon…
permissive · top 15,000 on PyPI
graphitesendSends metrics to Graphite's Carbon backend over…
unclear · top 15,000 on PyPI
aiodogstatsdAn asyncio-based client for sending metrics to…
permissive · top 15,000 on PyPI
datadogProvides a Python client library to send…
permissive · top 1,000 on PyPI
netflix-spectator-pyA thin-client metrics library that sends…
permissive · top 5,000 on PyPI