What is @types/datadog-metrics?
@types/datadog-metrics provides TypeScript type definitions for the datadog-metrics library, which is used to send custom metrics to Datadog. This package allows developers to leverage TypeScript's type-checking capabilities while using the datadog-metrics library.
What are @types/datadog-metrics's main functionalities?
Gauge
A gauge is a metric that represents a single numerical value that can arbitrarily go up and down. This code initializes the datadog-metrics library and sends a gauge metric with a value of 42.
const metrics = require('datadog-metrics');
metrics.init({
apiKey: 'YOUR_API_KEY'
});
metrics.gauge('test.gauge', 42);
Counter
A counter is a metric that represents a single numerical value that only ever goes up. This code initializes the datadog-metrics library and increments a counter metric.
const metrics = require('datadog-metrics');
metrics.init({
apiKey: 'YOUR_API_KEY'
});
metrics.increment('test.counter');
Histogram
A histogram is a metric that samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. This code initializes the datadog-metrics library and sends a histogram metric with a value of 42.
const metrics = require('datadog-metrics');
metrics.init({
apiKey: 'YOUR_API_KEY'
});
metrics.histogram('test.histogram', 42);
Set
A set is a metric that counts the number of unique elements in a group. This code initializes the datadog-metrics library and sends a set metric with a value of 42.
const metrics = require('datadog-metrics');
metrics.init({
apiKey: 'YOUR_API_KEY'
});
metrics.set('test.set', 42);
Other packages similar to @types/datadog-metrics
prom-client
prom-client is a Prometheus client for Node.js that allows you to instrument your application with custom metrics. It provides similar functionalities to datadog-metrics, such as counters, gauges, histograms, and summaries. However, it is designed to work with Prometheus rather than Datadog.
statsd
node-statsd is a client for Etsy's StatsD server, which aggregates and summarizes application metrics. It provides similar functionalities to datadog-metrics, such as counters, gauges, and timers. However, it is designed to work with StatsD rather than Datadog.
newrelic
newrelic is a Node.js agent for New Relic, which provides performance monitoring and management for web applications. It offers similar functionalities to datadog-metrics, such as custom metrics and transaction tracing, but it is designed to work with New Relic's monitoring platform.