TCP over TLS

If you want you can send your metrics over TCP using an encrypted tunnel. First, ensure each metric name is prefixed by your API key, then send your metric(s) using the Metric Data Format.

Host: carbon.hostedgraphite.com Port: 20030

It is not necessary (nor recommended) to create a new connection for each metric. You can put multiple metrics on separate lines. A long-lived connection will be faster because you won’t have to wait to establish a new connection each time. The following simple example shows how to send a single metric using Ncat on linux:

echo "YOUR-API-KEY.con_users 1.3" | ncat --ssl carbon.hostedgraphite.com 20030

   

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

echo "YOUR-API-KEY.con_users 1.3" |  openssl s_client -connect carbon.hostedgraphite.com:20030

   

For programming language-specific examples of sending metrics via TLS over TCP, check out our Language Guide.