PHPackages                             onema/php-datadogstatsd - 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. onema/php-datadogstatsd

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

onema/php-datadogstatsd
=======================

This is an extremely simple PHP datadogstatsd client. This is a fork of the library found in the https://www.datadoghq.com/ github repository.

0.4.1(9y ago)05.2kMITPHPPHP &gt;=5.3.0

Since Apr 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/onema/php-datadogstatsd)[ Packagist](https://packagist.org/packages/onema/php-datadogstatsd)[ Docs](https://github.com/onema/php-datadogstatsd)[ RSS](/packages/onema-php-datadogstatsd/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)DependenciesVersions (6)Used By (0)

PHP DataDog StatsD Client
=========================

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

This is an extremely simple PHP [datadogstatsd](http://www.datadoghq.com/) client. Requires PHP &gt;= 5.3.0.

See [CHANGELOG.md](CHANGELOG.md) for changes.

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

[](#installation)

### Composer

[](#composer)

Add the following to your `composer.json`:

```
"datadog/php-datadogstatsd": "0.3.*"

```

Note: The first version shipped in composer is 0.0.3

### Or manually

[](#or-manually)

Clone repository at [github.com/DataDog/php-datadogstatsd](https://github.com/DataDog/php-datadogstatsd)

Setup: `require './libraries/datadogstatsd.php';`

Usage
-----

[](#usage)

### Increment

[](#increment)

To increment things:

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

### Decrement

[](#decrement)

To decrement things:

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

### Timing

[](#timing)

To time things:

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

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

### Submitting events

[](#submitting-events)

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';

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

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.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor5

5 contributors hold 50%+ of commits

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 ~91 days

Total

2

Last Release

3627d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6de02da1f3fa7d732e6c083b1c03855d234b2ad5058cfa930e074703e1933b23?d=identicon)[onema](/maintainers/onema)

---

Top Contributors

[![hkaj](https://avatars.githubusercontent.com/u/5287287?v=4)](https://github.com/hkaj "hkaj (4 commits)")[![elafarge](https://avatars.githubusercontent.com/u/2692057?v=4)](https://github.com/elafarge "elafarge (4 commits)")[![onema](https://avatars.githubusercontent.com/u/532616?v=4)](https://github.com/onema "onema (4 commits)")[![seejohnrun](https://avatars.githubusercontent.com/u/64965?v=4)](https://github.com/seejohnrun "seejohnrun (4 commits)")[![LeoCavaille](https://avatars.githubusercontent.com/u/1788830?v=4)](https://github.com/LeoCavaille "LeoCavaille (3 commits)")[![clutchski](https://avatars.githubusercontent.com/u/92482?v=4)](https://github.com/clutchski "clutchski (2 commits)")[![celenechang](https://avatars.githubusercontent.com/u/6087353?v=4)](https://github.com/celenechang "celenechang (2 commits)")[![bigthyme](https://avatars.githubusercontent.com/u/1435322?v=4)](https://github.com/bigthyme "bigthyme (2 commits)")[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (1 commits)")[![testtechnovangelist](https://avatars.githubusercontent.com/u/10519867?v=4)](https://github.com/testtechnovangelist "testtechnovangelist (1 commits)")[![bunelr](https://avatars.githubusercontent.com/u/3354626?v=4)](https://github.com/bunelr "bunelr (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)")[![eirikhm](https://avatars.githubusercontent.com/u/996369?v=4)](https://github.com/eirikhm "eirikhm (1 commits)")[![Gipetto](https://avatars.githubusercontent.com/u/71515?v=4)](https://github.com/Gipetto "Gipetto (1 commits)")[![jklein](https://avatars.githubusercontent.com/u/629982?v=4)](https://github.com/jklein "jklein (1 commits)")[![LotharSee](https://avatars.githubusercontent.com/u/2720261?v=4)](https://github.com/LotharSee "LotharSee (1 commits)")

---

Tags

phpDataDog

### Embed Badge

![Health badge](/badges/onema-php-datadogstatsd/health.svg)

```
[![Health](https://phpackages.com/badges/onema-php-datadogstatsd/health.svg)](https://phpackages.com/packages/onema-php-datadogstatsd)
```

###  Alternatives

[inspector-apm/inspector-symfony

Code Execution Monitoring for Symfony applications.

2839.2k9](/packages/inspector-apm-inspector-symfony)

PHPackages © 2026

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