Skip to content

Instantly share code, notes, and snippets.

@alq666
Created July 31, 2012 18:45
Show Gist options
  • Save alq666/3219402 to your computer and use it in GitHub Desktop.
Save alq666/3219402 to your computer and use it in GitHub Desktop.
Setting up carbon-relay

For ubuntu:

Install graphite

sudo add-apt-repository ppa:muffinresearch/graphite
sudo apt-get update
sudo apt-get install python-graphite

Create /etc/carbon/relay-rules.conf

[default]
default = true
servers = 127.0.0.1:17124
#                   ^ should be the port defined as graphite_listen_port

Update /etc/carbon/carbon.conf to specify which port the relay will listen on

[relay]
# metrics should report to that ip/port
LINE_RECEIVER_INTERFACE = 0.0.0.0  
LINE_RECEIVER_PORT = 2005

# you don't need to talk to this interface
PICKLE_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_PORT = 2006

CACHE_SERVERS = localhost
MAX_QUEUE_SIZE = 10000

Start the relay

sudo carbon-relay --debug --config=/etc/carbon/carbon.conf --rules=/etc/carbon/relay-rules.conf start

Monitor the agent log file

tail -F /var/log/ddforwarder.log | grep graphite

And you should see things like

Posted metric: datadog.graphite.foo

Test with a graphite client

For instance

curl -L https://gist.github.com/3219398 > graphite.py
python graphite.py # adjust the ports as needed (should be the line receiver)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment