For the complete documentation index, see llms.txt. This page is also available as Markdown.

Shell

How to send metrics using Shell

Contents

Sending a metric via TCP

Using the netcat utility

echo "YOUR-API-KEY.foo 1.2" | nc carbon.hostedgraphite.com 2003

Sending a metric via UDP

Using the netcat utility

echo "YOUR-API-KEY.foo 1.2" | nc -uw0 carbon.hostedgraphite.com 2003

Sending a metric via TCP over TLS

Using the Ncat utility

Alternatively, the following example using OpenSSL should work out of the box in OS X:

Sending a metric via HTTPs

Using the Curl utility

Sending a metric via StatsD

Using the Ncat utility:

For StatsD, make sure to specify counters (c), gauges (g), or timers (ms).

Sending multiple metrics with Curl

where data.txt contains multiple metrics and values on a separate line:

Your API key can be found on your account home page.

Last updated