Hosted Graphite Docs
Get StartedBook a Demo
  • Welcome to Hosted Graphite
  • Getting Started
  • HG-CLI
  • Sending Metrics
    • Supported Protocols
    • Graphite Tag Support
    • Metric Management
    • Metric APIs
  • Language Guide
    • Metric Libraries
    • .NET
    • Go
    • Java
    • Javascript
    • Node.js
    • PHP
    • Postman
    • Python 2.x
    • Python 3.x
    • Python Pickle
    • Ruby
    • Shell
    • TypeScript
  • Dashboard and Graphs
    • Primary Dashboards
    • Dashboard Library
    • Local Dashboard Integration
    • Worldmap Panel
    • Graphite Dashboard Guide
    • Graphite Graph Menu Reference
    • Other Dashboard Options
  • Alerting Guide
    • Alerting Overview
    • Alerts API
    • Notification Channels API
    • Scheduled Mutes API
    • Using Your Own Alerting
  • Agents Guide
    • The Hosted Graphite Agent
      • Base Metrics
      • System Layout
    • Telegraf
    • K8 Telegraf Daemon
    • OpenTelemetry
    • collectd Agent
    • StatsD Agent
    • Diamond
  • Add-Ons and Integrations Guide
    • AWS CloudWatch
    • Azure Monitor Metrics
    • GCP Metrics
    • Carbon-C-Relay
    • Circle CI
    • Cloudbees
    • Collectd Add Ons
    • GitHub
    • GitLab
    • Heroku
    • Hosted StatsD
    • New Relic
    • Papertrail
    • Pingdom
    • Sentry
    • Sitespeed
    • StatsD Add-on
    • Statuspage
  • Account Management
    • Access Keys
    • Account Diagnostics
    • Account Settings
    • Team Access: Limited Access Groups
    • SAML Authentication
    • Team Access
  • Additional Features
    • Aggregation Rules
    • Data Views
  • API Guides
    • Metrics API
    • Tag API
    • Graphite Render API
    • Render Variables API
    • Dashboard API
    • Annotations and Events API
    • Aggregation Rules API
    • Alerts APIs
  • FAQ
    • General
    • Business
    • Technical
    • Account Metrics and Limiting
    • Customization
    • Troubleshooting
    • Support
    • Changelog
Powered by GitBook
On this page
  • TCP Connection
  • UDP Packets
  • HTTP POST
  • TCP Over TLS
  • StatsD
  • Quick Reference

Was this helpful?

  1. Sending Metrics

Supported Protocols

In this section, we will outline the most common protocols used to send metrics to Hosted Graphite, along with some useful examples.

PreviousSending MetricsNextGraphite Tag Support

Last updated 8 months ago

Was this helpful?

Contents

A simple way to send metrics to us is via a TCP connection. First, ensure each metric name is prefixed by your API key, then you securely send your metric(s) using the .

Host: carbon.hostedgraphite.com Port: 2003

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 TCP metric using the utility:

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

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

For a similar, but non-blocking alternative to TCP, you can use UDP packets to send the metric(s) to us. Ensure each metric name is prefixed by your API key () to securely send your UDP metric(s) using the .

Host: carbon.hostedgraphite.com Port: 2003

echo "YOUR-API-KEY.test.udp.metric 1.2" | nc -uw0 carbon.hostedgraphite.com 2003

You can send multiple metrics on separate lines as with TCP, but be aware there is a size limit of 8192 bytes for UDP packets.

POST your metrics to the following URL:

https://www.hostedgraphite.com/api/v1/sink

curl https://YOUR-API-KEY@www.hostedgraphite.com/api/v1/sink --data-binary "test.http.metric 1.2"

If your data was accepted, you will receive a HTTP/1.1 202 Accepted response, with no content body. If your data wasn’t accepted, you’ll receive a 400 error with more information about why.

Host: carbon.hostedgraphite.com Port: 20030

echo "YOUR-API-KEY.conc_users 59" | ncat --ssl carbon.hostedgraphite.com 20030
echo "YOUR-API-KEY.conc_users 59" |  openssl s_client -connect carbon.hostedgraphite.com:20030

Host: carbon.hostedgraphite.com Port: 8125

echo "YOUR-API-KEY.test.statsd.metric:1.2|c" | nc -u -w1 statsd.hostedgraphite.com 8125

You can send Graphite messages via:

Tip: Send your metrics to us in a non-blocking/asynchronous manner. Holding up processing to send metrics will skew the data (if it’s being used for performance analysis), and in the worst case have a negative impact on the responsiveness of your app to users.

Here’s a simple example using on linux:

For programming language-specific examples of sending metrics via UDP, check out our .

Your metric data should be provided in the as the HTTP POST payload. Don’t prefix your metric names with your - instead use it as the username for Basic Authentication.

Here’s an example using on linux, which lets you provide the API key in the URL.

For programming language-specific examples of sending metrics via HTTP POST, check out our .

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 .

The following simple example shows how to send a single metric using on linux:

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

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

StatsD is commonly used as a pre-aggregation service and sends metrics via UDP by default. First, ensure each metric name is prefixed by your API key, then send your metric(s) using the .

The following simple example shows how to send a single counter metric using on linux:

Find more information about using StatsD and Hosted StatsD in our .

TCP & UDP connections to carbon.hostedgraphite.com port 2003 (Metric names must be -prefixed)

TCP over TLS tunnel to carbon.hostedgraphite.com port 20030 (Metric names must be -prefixed)

HTTP POST to https://YOUR-API-KEY@www.hostedgraphite.com/api/v1/sink (Metric names are not -prefixed, HTTP 202 response on success)

StatsD to carbon.hostedgraphite.com port 8125 (Metric names must be -prefixed)

Python Pickle carbon.hostedgraphite.com port 2004 (discussed in the )

netcat
Language Guide
curl
Language Guide
Ncat
OpenSSL
Language Guide
Ncat
Add-ons and Integrations Guide
language guide
HTTP POST
TCP Over TLS
StatsD
Quick Reference
Supported Protocols
Netcat
Language Guide
TCP Connection
UDP Packets
HTTP POST
TCP Over TLS
StatsD
Quick Reference
TCP Connection
UDP Packets
Metric Data Format
Metric Data Format
see above
Metric Data Format
Metric Data Format
API Key
see above
Metric Data Format
API Key
API Key
API Key
API Key