Introduction to Graphite

What is graphite

Graphite provides real-time visualization and storage of numeric time-series data

Graphite does two things:

  1. Graphite stores numeric time-series data.
  2. Graphite renders graphs of this data on demand.

Graphite consits of 3 parts

  1. carbon - a daemon that listens for time-series data
  2. whisper - a simple database library for storing time-series data
  3. webapp - a (Django) webapp that renders graphs on demand


Python twisted daemons that listens for time-series data

  • megacarbon?


    • accepts metrics over various protocols and writes them to disk as efficiently as possible
    • caches metric values in RAM as they are received
    • flushes them to disk on an interval using the underlying whisper library
  • carbon.conf
    • [cache] section
  • storage-schemas.conf
    • Defines a retention policy for metrics based on regex patterns
    • This policy is passed to whisper when .wsp file is pre-allocated,and dictates how long data is stored for.

To scale out, simple run multiple instances bebind a or

  • For replication and sharding
  • RELAY_METHOD = rules |  consistent-hashing
  • carbon.conf
    • [replay] section   (REPLAY_METHOD)
  • relay-rules.conf
    • REPLAY_METHOD = rules, pattern/servers tuples define what servers metrics matching certain regex rules are forwarded to

Buffer and Aggregator in front of

Whisper Libary

A simple database libaray for storing time-series data (like RRD)


<key> <numric value> <timestamp>


Graphite matches data paths with a pattern and tells what frequency and history for our data to store

The retention format is  frequency:history

pattern = ^stats\..*
retentions = 1m:7d,15m:120d