Skip to content
No description, website, or topics provided.
PHP Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.php_cs
CHANGELOG.md
CONTRIBUTING.md
LICENSE.md
Makefile
README.md
composer.json

README.md

Laravel DataDog

Packagist Packagist Packagist Buy us a tree

A simple package to use DataDog Series Metric using their API via TCP

Why?

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.

Other packages

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.

Installation

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

How to use

Increment a Metric

\DataDog::increment('app.pageview');

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

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email james@jamesmills.co.uk instead of using the issue tracker.

Treeware

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

Credits

License

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

You can’t perform that action at this time.