Skip to content

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

License

Notifications You must be signed in to change notification settings

gopaljha/laravel-datadog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Issues GitHub Forks GitHub Stars GitHub License Twitter

Laravel DataDog

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 gopaljha/laravel-datadog
$providers = [
    GopalJha\LaravelDataDog\LaravelDataDogServiceProvider::class,
]

Publish the config file

php artisan vendor:publish --provider="GopalJha\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', ['tag' => 'one', 'tag' => 'two']);

You can also send a custom host if you require.

\DataDog::increment('app.pageview', ['tag' => 'one', 'tag' => 'two'], 'example.com');

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages