🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

datadog-light

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datadog-light

Lightweight SDK to access Datadog API

5.0.1
latest
Source
npm
Version published
Maintainers
0
Created
Source

datadog-light

Build Status Test Coverage Dependabot Status Dependencies NPM Downloads Semantic-Release Gardener

Lightweight SDK to access Datadog API

Install

Install with npm:

$ npm install --save datadog-light

Usage

import Datadog from 'datadog-light';

const dd = Datadog('DATADOG_API_KEY');

dd.DistributionMetric.enqueue('metric.name', [new Date() / 1]);
dd.DistributionMetric.flush();

All input is validated using Joi.

Functions

Constructor (API_KEY, { tags: Array = [] })

Initialize this sdk with a Datadog api key. Provided tags are sent with all metrics without having to specify them again.

DistributionMetric

enqueue(metric: String, Array[Unix] | Object(Unix: Count), { tags: Array = [] })

Enqueue distribution metric counts

flush(): Promise

Flush all metric events currently enqueued.

Why does this package exist?

This package was built to be used in serverless environments where state is hard to come by. Convenient when e.g. tracking certain actions within an AWS Lambda function.

Keywords

datadog

FAQs

Package last updated on 29 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts