Socket
Socket
Sign inDemoInstall

dogapi

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dogapi

Datadog API Node.JS Client


Version published
Weekly downloads
1.2M
decreased by-2.22%
Maintainers
1
Weekly downloads
 
Created

What is dogapi?

The dogapi npm package is a client library for interacting with the Datadog API. It allows developers to programmatically manage Datadog resources such as events, metrics, tags, and more.

What are dogapi's main functionalities?

Send Metrics

This feature allows you to send custom metrics to Datadog. The code sample demonstrates how to initialize the dogapi client and send a metric named 'test.metric' with a value of 100 and a tag 'environment:test'.

const dogapi = require('dogapi');
const options = { api_key: 'YOUR_API_KEY', app_key: 'YOUR_APP_KEY' };
dogapi.initialize(options);
dogapi.metric.send('test.metric', 100, { tags: ['environment:test'] }, function(err, results) {
  if (err) console.error(err);
  else console.log(results);
});

Post Events

This feature allows you to post events to Datadog. The code sample shows how to create an event with a title 'Event Title' and text 'Event Text', along with a tag 'environment:test'.

const dogapi = require('dogapi');
const options = { api_key: 'YOUR_API_KEY', app_key: 'YOUR_APP_KEY' };
dogapi.initialize(options);
dogapi.event.create('Event Title', 'Event Text', { tags: ['environment:test'] }, function(err, results) {
  if (err) console.error(err);
  else console.log(results);
});

Manage Tags

This feature allows you to manage tags for your Datadog resources. The code sample demonstrates how to add tags 'tag1' and 'tag2' to a host named 'myhost'.

const dogapi = require('dogapi');
const options = { api_key: 'YOUR_API_KEY', app_key: 'YOUR_APP_KEY' };
dogapi.initialize(options);
dogapi.tag.create('host:myhost', ['tag1', 'tag2'], function(err, results) {
  if (err) console.error(err);
  else console.log(results);
});

Other packages similar to dogapi

Keywords

FAQs

Package last updated on 22 Mar 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc