Skip to content

tmm1/graphite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 Overview
-------------------------------------------------------------------------------
Graphite consists of two major components

 1) the frontend Django webapp that runs under mod_python Apache
 2) the backend carbon-agent.py daemon

Client applications connect to the running carbon-agent.py daemon on port 2003 and send it
lines of text of the following format:

"my.metric.name value unix_timestamp", for example:

"performance.servers.www01.cpuUsage 42.5 1208815315"

The metric name is like a filesystem path that uses . as a separator instead of /
The value is some scalar integer or floating point value
The unix_timestamp is unix epoch time, as an integer

Each line like this corresponds to one data point for one metric.

Once you've got some clients sending data to carbon-agent, you can view
graphs of that data in the frontend webapp.


 Webapp Installation
-------------------------------------------------------------------------------
Use the instructions in the INSTALL file.


 Running carbon-agent.py
-------------------------------------------------------------------------------
NOTE: This section is no longer necessary to perform manually. It is now taken
      care of by the post-install.py script. Only use this as a reference if you
      are troubleshooting a problem or trying to do something fancy.

Decide what user you want to run carbon-agent.py as, for this example I'll use 'nobody'.

# First we tell carbon-agent what user it should run as
# This should be the same user that apache runs as
cd /usr/local/graphite/carbon/
sudo bash -c "echo -n nobody > run_as_user"

# Next we must make sure that the carbon-agent/apache user owns the storage directory.
sudo chown -R nobody /usr/local/graphite/storage/

# Also need to chown the log and pid directories for carbon-agent
sudo chown -R nobody /usr/local/graphite/carbon/log
sudo chown -R nobody /usr/local/graphite/carbon/pid

# Now you just start carbon-agent
sudo /etc/init.d/carbon-agent.sh start

# Now watch the logs to verify that everything is running without errors
cd /usr/local/graphite/carbon/
tail -f log/*.log


 Writing a client
-------------------------------------------------------------------------------
First you obviously need to decide what data it is you want to graph with
graphite. The script examples/example-client.py demonstrates a simple client
that sends loadavg data for your local machine to carbon on a minutely basis.

The default storage schema stores data in one-minute intervals for 2 hours.
This is probably not what you want so you should create a custom storage schema
according to the docs on the graphite wiki (http://graphite.wikidot.com)