Skip to content
Node.js metrics

Export Node.js metrics with hot-shots

Clever Cloud applications expose a StatsD endpoint that accepts custom metrics over UDP. For Node.js applications, use the maintained hot-shots client.

Install it as an application dependency:

npm install hot-shots

Create a client with its default configuration, then send the metrics your application needs:

const StatsD = require("hot-shots")

const client = new StatsD()

// Increment a counter by one
client.increment("my_counter")

// Record the current value of a gauge
client.gauge("my_gauge", 123.45)

The default host and port used by hot-shots match the StatsD endpoint available to Clever Cloud applications, so no additional environment variable is required. Use a stable metric name and add only low-cardinality tags when you need to distinguish a small number of cases.

Learn more

Last updated on