PHPackages                             vend/statsd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. vend/statsd

AbandonedArchivedLibrary[Logging &amp; Monitoring](/categories/logging)

vend/statsd
===========

Simple extensible StatsD client library for PHP 5.5+

v1.1.1(10y ago)3289.8k↓91.7%1MITPHPPHP &gt;=5.5.0

Since Dec 1Pushed 3y agoCompare

[ Source](https://github.com/vend/statsd)[ Packagist](https://packagist.org/packages/vend/statsd)[ Docs](https://github.com/vend/statsd/)[ RSS](/packages/vend-statsd/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (9)Used By (0)

vend/statsd
===========

[](#vendstatsd)

Simple extensible StatsD client for PHP 5.5+
--------------------------------------------

[](#simple-extensible-statsd-client-for-php-55)

[![Build Status](https://camo.githubusercontent.com/41fe3553831ae3b7dcafbe98fed19511b0eee2db6583847cfc3357360e9a468c/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f76656e642f7374617473642e706e67)](http://travis-ci.org/vend/statsd)[![Code Coverage](https://camo.githubusercontent.com/6ec21d83004ee8b107daee28c753168ae0e07f2daf6049ab302fdc8371eee340/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f76656e642f7374617473642f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vend/statsd/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/370efe2c414fa040a9d2f4cbcaba81ad1ac45e276ba56de762f5d0a3705bf4b8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f76656e642f7374617473642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vend/statsd/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/2457e4b994f4a408d856bad82f4e639c8bce706f5d54da43ab7c36a60c034c08/68747470733a2f2f706f7365722e707567782e6f72672f76656e642f7374617473642f76657273696f6e)](https://packagist.org/packages/vend/statsd)[![Latest Unstable Version](https://camo.githubusercontent.com/48fdd96bf0347c40cdefff3c59eba327fafa89718a0a3cd5ec250557f56ccfb5/68747470733a2f2f706f7365722e707567782e6f72672f76656e642f7374617473642f762f756e737461626c65)](//packagist.org/packages/vend/statsd)

### Features

[](#features)

- Correctly splits large numbers of metrics across multiple datagrams
- Can substitute out the underlying format of the metrics being sent, to support things like Datadog's tags and histograms
- Supports sample rates, but leaves skipping the send to the caller (use the factory and socket directly)
- Doesn't block during metric sending, and only supports UDP (opinionated, but that's all you should need)

### Usage

[](#usage)

This library uses dependency injection throughout. To instantiate a Client, you'll need a Socket and a Factory:

```
use Vend\Statsd\Client;
use Vend\Statsd\Socket;
use Vend\Statsd\Factory;

$client = new Client(
    new Socket(),
    new Factory()
);
```

Once you have a client, you can use the familiar statsd methods to enqueue metrics on the client. The client doesn't send them until `->flush()` is called.

```
$client->increment('some.metric_key'); // incremented by 1
$client->decrement('some.metric_key'); // decremented by 1
$client->counter('some.counter', 3);   // incremented by 3
$client->gauge('some.gauge', 10);
$client->timer('some.timer', 0.25);
$client->set('some.set', 'some_value');

$client->flush(); // actually sends the metrics
```

These methods return the `MetricInterface` produced by the factory (so you can then attach extra information).

You can also use the factory and socket to directly and immediately send metrics. The `->getData()` method on `MetricInterface`provides the serialized string that should be sent to the statsd server.

```
$socket = new Socket('127.0.0.1', 8125);
$factory = new Factory();

$socket->open();
$socket->write($factory->increment('some.key')->getData());
$socket->close();
```

#### Extending

[](#extending)

For an example of how to extend the library, see the `Vend\Statsd\Datadog` namespace. A different `Factory` is used by passing it to the Client. The Datadog-specific factory will allow the metrics to carry tag information.

#### `NullClient`, `ClientAwareInterface` and `ClientAwareTrait`

[](#nullclient-clientawareinterface-and-clientawaretrait)

Helpful utility classes for performing optional (setter) injection of statsd clients into your classes. Use them in pretty much the same way as their PSR3 equivalents.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

6

Last Release

3789d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe0e32939757c85ef7a924309394e302896dbb32e18ac2f4b9b0b1c4793b8339?d=identicon)[edsrzf](/maintainers/edsrzf)

---

Top Contributors

[![ls-stephanie](https://avatars.githubusercontent.com/u/100098437?v=4)](https://github.com/ls-stephanie "ls-stephanie (1 commits)")

---

Tags

backstage-excludemonitoringstatsd

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vend-statsd/health.svg)

```
[![Health](https://phpackages.com/badges/vend-statsd/health.svg)](https://phpackages.com/packages/vend-statsd)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

34424.8M87](/packages/rollbar-rollbar)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19127.3M16](/packages/datadog-php-datadogstatsd)[illuminate/log

The Illuminate Log package.

6225.3M623](/packages/illuminate-log)[liuggio/statsd-php-client

Statsd (Object Oriented) client library for PHP

1154.0M15](/packages/liuggio-statsd-php-client)[slickdeals/statsd

a PHP client for statsd

274.9M13](/packages/slickdeals-statsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
