A simple package to use DataDog Series Metric using their API via TCP
Because some people cannot install the DataDog Agent or StatsD. So we have to use DataDog API to send data. Using the API losses the advantage of using UDP (unblocking) calls. This package gives you a nice way to send metric information and also make sure the jobs are queued.
This package should only be used if you also find yourslef in the unique situation where you cannot use the DataDog Agent. Make sure you investigate the below packages first.
Pull in the package using Composer
composer require jamesmills/laravel-datadog
Publish the config file
php artisan vendor:publish --provider="JamesMills\LaravelDataDog\LaravelDataDogServiceProvider" --tag=config
Set your DataDog API key in your
.env file using the key
How to use
Increment a Metric
Increment a Metric with tagging and Host
A powerful feature of DataDog is the ability to tag things.
\DataDog::increment('app.pageview', ['my:tag:one', 'my:tag:two']);
You can also send a custom host if you require.
\DataDog::increment('app.pageview', ['my:tag:one', 'my:tag:two'], 'my.host.com');
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email firstname.lastname@example.org instead of using the issue tracker.
You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.
It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you contribute to my forest you’ll be creating employment for local families and restoring wildlife habitats.
You can buy trees at my forest here offset.earth/jamesmills
The MIT License (MIT). Please see License File for more information.