Shell

How to send metrics using Shell

Contents

Using the netcat utility

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

Using the netcat utility

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

Using the Ncat utility

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

Using the Curl utility

Using the Ncat utility:

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

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

Was this helpful?