2017 © Pedro Peláez
 

library 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.

image

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.

  • Wednesday, July 27, 2016
  • by onema
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5,180 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 69 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

PHP DataDog StatsD Client

This is an extremely simple PHP datadogstatsd client. Requires PHP >= 5.3.0., (*1)

See CHANGELOG.md for changes., (*2)

Installation

Composer

Add the following to your composer.json:, (*3)

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

Note: The first version shipped in composer is 0.0.3, (*4)

Or manually

Clone repository at github.com/DataDog/php-datadogstatsd, (*5)

Setup: require './libraries/datadogstatsd.php';, (*6)

Usage

Increment

To increment things:, (*7)

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


### Decrement To decrement things: ``` php DogStatsd::decrement('your.data.point');

Timing

To time things:, (*9)

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

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


### 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. ``` php $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., (*12)

For more documentation on the optional values of events, see http://docs.datadoghq.com/api/#events/., (*13)

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., (*14)

The Versions

27/07 2016

dev-master

9999999-dev https://github.com/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.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Juan Manuel Torres
by Avatar DataDog
by Alex Corley

php datadog

27/07 2016

0.4.1

0.4.1.0 https://github.com/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.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Juan Manuel Torres
by Avatar DataDog
by Alex Corley

php datadog

27/07 2016

dev-develop-event-fix

dev-develop-event-fix https://github.com/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.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Juan Manuel Torres
by Avatar DataDog
by Alex Corley

php datadog

26/04 2016

dev-develop

dev-develop https://github.com/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.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Juan Manuel Torres
by Avatar DataDog
by Alex Corley

php datadog

26/04 2016

0.4.0

0.4.0.0 https://github.com/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.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Juan Manuel Torres
by Avatar DataDog
by Alex Corley

php datadog

20/04 2016

dev-events-over-udp

dev-events-over-udp https://www.datadoghq.com/

This is an extremely simple PHP datadogstatsd client

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar DataDog
by Alex Corley

php datadog