8000 GitHub - romainnorberg/datadog-api at v0.2-beta
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The missing DataDog API PHP Wrapper! A lightweight package to fetch metrics from Datadog

License

Notifications You must be signed in to change notification settings

romainnorberg/datadog-api

Repository files navigation

DO NOT USE YET, PACKAGE IN DEVELOPMENT

DataDog-api

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A lightweight packages to fetch metrics from Datadog

Actual scope

  • Metrics doc
    • ✅ Get active list
    • ✅ Get metadata
    • ✅ Query timeseries points
    • Edit metadata
    • Search
    • Submit metrics

Installation

You can install the package via composer:

composer require romainnorberg/datadog-api

Usage / examples

Instantiation

use Romainnorberg\DataDogApi\DataDogApi;

// Using env (DATADOG_API_KEY & DATADOG_APPLICATION_KEY)
$datadogApi = new DataDogApi();  

// Using arguments
$datadogApi = new DataDogApi('<apiKey>', '<applicationKey>');

Fetching metrics

use Romainnorberg\DataDogApi\DataDogApi;

$datadogApi = new DataDogApi(); // Using env 

$metrics = $datadogApi
            ->metrics()
            ->query()
            ->from((new \DateTime())->sub(new \DateInterval('PT1H')))
            ->to(new \DateTime())
            ->query('avg:worker.memory.heapUsed{*}')
            ->handle();

Testing

composer test

Changelog

Please see CHANGELOG< 74AC /a> for more information on what has changed recently.

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email romainnorberg@gmail.com instead of using the issue tracker.

Credits

License

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

About

The missing DataDog API PHP Wrapper! A lightweight package to fetch metrics from Datadog

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

0