A Laravel Datadog helper package.
chaseconey/laravel-datadog-helper is a Laravel package for a laravel datadog helper package..
It currently has 75 GitHub stars and 2.479.794 downloads on Packagist (latest version 1.3.0).
Install it with composer require chaseconey/laravel-datadog-helper.
Discover more Laravel packages by chaseconey
or browse all Laravel packages to compare alternatives.
Last updated
Laravel Datadog Helper helps you get your application metrics integrated into Laravel as fast as possible.
Require this package with composer.
composer require chaseconey/laravel-datadog-helper
Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
If you would like to install the request metric tracking middleware, add the Datadog middleware class like so:
// app/Http/Kernel.php
protected $middleware = [
...
\ChaseConey\LaravelDatadogHelper\Middleware\LaravelDatadogMiddleware::class
];
If you don't use auto-discovery, or you are using an older version of Laravel, add the ServiceProvider to the providers array in config/app.php
// config/app.php
'providers' => [
...
ChaseConey\LaravelDatadogHelper\LaravelDatadogHelperServiceProvider::class,
];
If you want to use the facade, add this to your facades in config/app.php:
// config/app.php
'aliases' => [
...
'Datadog' => ChaseConey\LaravelDatadogHelper\Datadog::class
];
For configuration options, copy the package config to your local config with the publish command:
php artisan vendor:publish --provider="ChaseConey\LaravelDatadogHelper\LaravelDatadogHelperServiceProvider"
This package comes with a handy middleware that you can add to any Laravel project to get up and running in Datadog as fast as possible.
request_timestatus_codeurl (toggle via datadog.middleware_disable_url_tag config option)datadog.global_tagsWith just these metrics here are a couple of example graphs that you can make:

{
"viz": "heatmap",
"requests": [
{
"q": "max:app.example.request_time.max{*} by {url}",
"type": null,
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
},
"aggregator": "avg",
"conditional_formats": []
}
],
"autoscale": true
}
{
"viz": "toplist",
"requests": [
{
"q": "top(sum:app.example.request_time.count{*} by {url}.as_count(), 10, 'sum', 'desc')",
"type": null,
"style": {
"palette": "warm",
"type": "solid",
"width": "normal"
},
"conditional_formats": []
}
]
}
{
"viz": "toplist",
"requests": [
{
"q": "top(max:app.example.request_time.max{*} by {url}, 10, 'max', 'desc')",
"type": null,
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
},
"conditional_formats": [
{
"palette": "white_on_red",
"value": 5,
"comparator": ">"
},
{
"palette": "white_on_green",
"value": 5,
"comparator": "<="
}
]
}
]
}
This library wraps the official DataDog/php-datadogstatsd library. All functions are inherited from the core implementation provided by this library with the exception of replacing Datadogstatsd with Datadog (the facade).
For example:
Instead of doing Datadogstatsd::increment('my.sweet.metrics'), you would use Datadog::increment('my.sweet.metrics').
For a full set of usage examples, check out the library's usage README.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING and CONDUCT for details.
The MIT License (MIT). Please see License File for more information.