All Projects β†’ graze β†’ dog-statsd

graze / dog-statsd

Licence: other
🐢 DataDog StatsD Client

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to dog-statsd

heroku-datadog-drain-golang
Funnel metrics from multiple Heroku apps into DataDog using statsd.
Stars: ✭ 34 (-10.53%)
Mutual labels:  statsd, datadog
aiodogstatsd
An asyncio-based client for sending metrics to StatsD with support of DogStatsD extension
Stars: ✭ 26 (-31.58%)
Mutual labels:  statsd-client, statsd
Datadog Go
go dogstatsd client library for datadog
Stars: ✭ 238 (+526.32%)
Mutual labels:  statsd, datadog
rust-statsd
Statsd client implemented in Rust
Stars: ✭ 50 (+31.58%)
Mutual labels:  statsd-client, statsd
Graylog Plugin Metrics Reporter
Graylog Metrics Reporter Plugins
Stars: ✭ 71 (+86.84%)
Mutual labels:  statsd, datadog
Java Dogstatsd Client
a java statsd client library
Stars: ✭ 140 (+268.42%)
Mutual labels:  statsd, datadog
statsd.cr
A statsd client library for Crystal.
Stars: ✭ 32 (-15.79%)
Mutual labels:  statsd, datadog
paStash
pastaΚƒ'Κƒ = Spaghetti I/O Event Data Processing, Interpolation, Correlation and beyond 🍝
Stars: ✭ 89 (+134.21%)
Mutual labels:  statsd
docker-graphite
Run Graphite with Docker
Stars: ✭ 15 (-60.53%)
Mutual labels:  statsd
graphite-client
Windows (.NET) library and tools for feeding data into Graphite and statsD.
Stars: ✭ 85 (+123.68%)
Mutual labels:  statsd
datadog-to-terraform
Converts Datadog resource JSON into Terraform alarm code.
Stars: ✭ 191 (+402.63%)
Mutual labels:  datadog
datadog-actions-metrics
Send GitHub Actions metrics to Datadog
Stars: ✭ 27 (-28.95%)
Mutual labels:  datadog
datadog monitor2terraform
Import DataDog monitor rule and generate Terraform resource configuration
Stars: ✭ 14 (-63.16%)
Mutual labels:  datadog
road-to-orleans
This repository illustrates the road to orleans with practical, real-life examples. From most basic, to more advanced techniques.
Stars: ✭ 55 (+44.74%)
Mutual labels:  datadog
python-monitoring-talk
Materials for my talks and articles on monitoring with focus on Python applications
Stars: ✭ 32 (-15.79%)
Mutual labels:  statsd
dats
πŸ“ˆ Minimalistic zero-dependencies statsd client for Node.js
Stars: ✭ 63 (+65.79%)
Mutual labels:  statsd
nebulous
The Kubefirst Open Source Platform
Stars: ✭ 122 (+221.05%)
Mutual labels:  datadog
scaladog
Datadog API client for Scala.
Stars: ✭ 29 (-23.68%)
Mutual labels:  datadog
sentry-prometheus
Export hosted sentry statsd metrics to prometheus
Stars: ✭ 22 (-42.11%)
Mutual labels:  statsd
gin-statsd
A Gin middleware for reporting to statsd daemon
Stars: ✭ 33 (-13.16%)
Mutual labels:  statsd

graze/dog-statsd

Giphy

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Client to talk to DataDogs StatsD Agent Forked from: League/StatsD

For more information on the metric, see: Datadogs metrics guide.

Install

Via Composer

$ composer require graze/dog-statsd

Usage

Configuring

$statsd = new Graze\DogStatsD\Client();
$statsd->configure([
    'host' => '127.0.0.1',
    'port' => 8125,
    'namespace' => 'example',
]);

OR

$statsd1 = DogStatsD\Client::instance('server1')->configure([...]);
$statsd2 = DogStatsD\Client::instance('server2')->configure([...]);

The StatsD client waits for ini_get('default_socket_timeout') seconds when opening the socket by default. To reduce this timeout, add 'timeout' => <int> to your config.

The StatsD client will either throw a ConnectionException, throw a warning or ignore all errors if it is unable to send data to the StatsD server. This can be configured using the onError property

    'onError' => 'error' // 'error', 'exception' or 'ignore'

By default this is set to 'error'

Core StatsD implementation

To use this with a core statsd implementation (without the extra features DataDog have added) include the following in your configuration:

'dataDog' => false

Methods

Counters

$statsd->increment('web.pageview');
$statsd->decrement('storage.remaining');
$statsd->increment([
    'first.metric',
    'second.metric'
], 2);
$statsd->increment('web.clicks', 1, 0.5);

Gauges

$statsd->gauge('api.logged_in_users', 123456);

Sets

$userID = 23;
$statsd->set('api.unique_logins', $userID);

Histogram

$result = $db->fetch();
$statsd->histogram('db.results', count($result), 0.5);

Timers

$statsd->timing('api.response_time', 256);

Timing Blocks

$statsd->time('api.dbcall', function () {
    // this code execution will be timed and recorded in ms
});

Tags

$statsd->increment('web.pageview', 1, ['page' => 'some/page']);
$statsd->guage('api.logged_in_users', 123456, ['environement' => 'live']);
$statsd->set('api.unique_logins', $userID, ['tag']);
$statsd->timing('api.response_time', 245, ['end-point' => 'page', 'env' => 'test']);
Tags Processors

You can add tag processors to inject tags at runtime for each metric.

$statsd->addTagProcessor(function (array $tags) {
    $tags['new-key'] = 'new-value';
    return $tags;
});

Events

$statsd->event(
    'build.success',
    'The build super_awesome_application_build_1 has completed',
    [
        'time'  => time(),
        'alert' => Client::ALERT_SUCCESS,
    ],
    [
        'environment' => 'live',
    ]
);

Service Check

$statsd->serviceCheck(
    'service.api.account',
    Client::STATUS_OK,
    [
        'host' => 'this.hostname.com',
        'time' => time(),
    ],
    [
        'environment' => 'staging',
    ]
);

Default Tags

Send the same base tags with every request

$client = new Client();
$client->configure([
    'tags' => [
        'env'     => 'live',
        'release' => 'app-2.3.1',
    ],
]);

Testing

$ make test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

Forked from thephpleague/statsd:

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].