PHPackages                             lsjroberts/datadog-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. lsjroberts/datadog-statsd

Abandoned → [league/statsd](/?search=league%2Fstatsd)Library

lsjroberts/datadog-statsd
=========================

DataDog Statsd client

v0.1.1(13y ago)6135.2k↓22.2%1MITPHP

Since Apr 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/lsjroberts/datadog-statsd)[ Packagist](https://packagist.org/packages/lsjroberts/datadog-statsd)[ RSS](/packages/lsjroberts-datadog-statsd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

PHP DataDog Statsd Client
=========================

[](#php-datadog-statsd-client)

Forked from .

Installation
------------

[](#installation)

### Composer

[](#composer)

Add the following to your `composer.json`:

```
"lsjroberts/datadog-statsd": "0.1.*"

```

Setup
-----

[](#setup)

### Laravel 4

[](#laravel-4)

Add the service provider to your Laravel application in `app/config/app.php`. In the `providers` array add:

```
'DataDog\Statsd\StatsdServiceProvider',

```

And then alias it by adding the facade to the `facades` array in the same file:

```
'Statsd' => 'DataDog\Statsd\Facades\Illuminate',

```

### Standalone

[](#standalone)

If you are using another framework or writing a standalone project you can just call:

```
use DataDog\Statsd\Facades\Agnostic as Statsd;

```

Usage
-----

[](#usage)

### Increment

[](#increment)

To increment things:

```
Statsd::increment('your.data.point');
Statsd::increment('your.data.point', .5);
Statsd::increment('your.data.point', 1, array('tagname' => 'value'));
```

### Decrement

[](#decrement)

To decrement things:

```
Statsd::decrement('your.data.point');
```

### Timing

[](#timing)

To time things:

```
$start_time = microtime(true);
run_function();
Statsd::timing('your.data.point', microtime(true) - $start_time);

Statsd::timing('your.data.point', microtime(true) - $start_time, 1, array('tagname' => 'value'));
```

### Submitting events

[](#submitting-events)

Requires PHP &gt;= 5.3.0 and the [PECL http](http://www.php.net/manual/en/http.install.php) extension

To submit events, you'll need to first configure the library with your Datadog credentials, since the event function submits directly to Datadog instead of sending to a local dogstatsd instance.

```
$apiKey = 'myApiKey';
$appKey = 'myAppKey';

Statsd::configure($apiKey, $appKey);
Statsd::event('A thing broke!', array(
	'alert_type'      => 'error',
	'aggregation_key' => 'test_aggr'
));
Statsd::event('Now it is fixed.', array(
	'alert_type'      => 'success',
	'aggregation_key' => 'test_aggr'
));
```

This is what you'd see your Datadog event stream:

[![screenshot](https://camo.githubusercontent.com/5f8fab765c8bbcfcdb9754022616331bd8275178c7c168ed630422106d4a40b4/68747470733a2f2f696d672e736b697463682e636f6d2f32303132303831372d6336706931653535727332786a74336b7470326b3168363765372e706e67)](https://camo.githubusercontent.com/5f8fab765c8bbcfcdb9754022616331bd8275178c7c168ed630422106d4a40b4/68747470733a2f2f696d672e736b697463682e636f6d2f32303132303831372d6336706931653535727332786a74336b7470326b3168363765372e706e67)

You can find your api and app keys in the [API tab](https://app.datadoghq.com/account/settings#api).

For more documentation on the optional values of events, see .

Note that while sending metrics with this library is fast since it's sending locally over UDP, sending events will be slow because it's sending data directly to Datadog over HTTP. We'd like to improve this in the near future.

Original Author
---------------

[](#original-author)

Alex Corley -

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~0 days

Total

2

Last Release

4771d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/945f150305b7526987a393f73928b51390a0d4d5c60e13ef95d677f2013bf595?d=identicon)[lsjroberts](/maintainers/lsjroberts)

---

Top Contributors

[![lsjroberts](https://avatars.githubusercontent.com/u/3817697?v=4)](https://github.com/lsjroberts "lsjroberts (15 commits)")[![seejohnrun](https://avatars.githubusercontent.com/u/64965?v=4)](https://github.com/seejohnrun "seejohnrun (4 commits)")[![clutchski](https://avatars.githubusercontent.com/u/92482?v=4)](https://github.com/clutchski "clutchski (2 commits)")[![eirikhm](https://avatars.githubusercontent.com/u/996369?v=4)](https://github.com/eirikhm "eirikhm (1 commits)")[![dubcanada](https://avatars.githubusercontent.com/u/120325?v=4)](https://github.com/dubcanada "dubcanada (1 commits)")[![conorbranagan](https://avatars.githubusercontent.com/u/472446?v=4)](https://github.com/conorbranagan "conorbranagan (1 commits)")[![ddalq](https://avatars.githubusercontent.com/u/209672338?v=4)](https://github.com/ddalq "ddalq (1 commits)")

---

Tags

phpstatsdDataDog

### Embed Badge

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

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

###  Alternatives

[datadog/dd-trace

PHP APM Client

55020.5M15](/packages/datadog-dd-trace)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19024.6M15](/packages/datadog-php-datadogstatsd)[liuggio/statsd-php-client

Statsd (Object Oriented) client library for PHP

1153.9M9](/packages/liuggio-statsd-php-client)[graze/dog-statsd

DataDog StatsD Client

413.1M3](/packages/graze-dog-statsd)[m6web/statsd

Component easing the statsd usage

131.0M2](/packages/m6web-statsd)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

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