skillfed

statsd

A simple statsd client.

statsd v4.0.1 18.0M downloads/30d#1,093 on PyPI553
Permissive license MIT Active released

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 statsd

uv

uv add statsd

poetry

poetry add statsd

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

statsd client pythonmetrics collection graphitecounter timer gauge monitoringstatsd daemon integrationapplication metrics trackingperformance monitoring clientreal-time metrics reporting
metricsmonitoringgraphite

More Python Modules packages