Introduction
Graphite, created in 2006, pioneered the modern metrics stack. It receives numeric time-series data, stores it efficiently with configurable retention, and exposes a powerful render API with hundreds of transformation functions for building graphs and dashboards.
What Graphite Does
- Accepts metrics via plaintext, pickle, or AMQP protocols on well-known ports
- Stores time-series data with automatic rollup and retention policies (Whisper format)
- Provides a render API with 100+ functions for aggregation, math, and filtering
- Ships a built-in web UI (Graphite-web) for interactive graph exploration
- Feeds data to Grafana and other dashboarding tools via its native API
Architecture Overview
Graphite has three components. Carbon is the daemon that receives metrics and writes them to disk. Whisper is a fixed-size database format (similar to RRD) that stores time-series data with multiple retention levels. Graphite-web is a Django application that reads Whisper files and renders graphs via the Render API. Carbon-relay and carbon-aggregator handle sharding and pre-aggregation at scale.
Self-Hosting & Configuration
- Carbon config in
carbon.conf: setLINE_RECEIVER_PORT(2003) andMAX_CREATES_PER_MINUTE - Define retention schemas in
storage-schemas.conf(e.g.,10s:6h,1m:7d,10m:1y) - Set aggregation methods in
storage-aggregation.conf(sum, average, min, max) - Scale horizontally with carbon-relay consistent-hashing across multiple carbon-cache instances
- Use Graphite-web or Grafana as the frontend query and visualization layer
Key Features
- 100+ render API functions: summarize, derivative, movingAverage, scale, alias
- Wildcard and glob patterns in metric paths for flexible querying
- Automatic downsampling: high-resolution data rolls up to coarser intervals over time
- Tags support (since Graphite 1.1): key=value metadata on metric series
- StatsD integration: aggregate application-level counters, timers, and gauges
Comparison with Similar Tools
- Prometheus — pull-based with PromQL; Graphite is push-based with its own function API
- InfluxDB — SQL-like query language (Flux/InfluxQL); Graphite uses a function-chain API
- VictoriaMetrics — Prometheus-compatible, higher performance; Graphite has a longer ecosystem history
- TimescaleDB — SQL on time-series; Graphite is purpose-built for metrics rendering
FAQ
Q: Is Graphite still actively maintained? A: Yes. The graphite-project organization on GitHub continues to release updates for Carbon, Whisper, and Graphite-web.
Q: How does Graphite handle high cardinality? A: Each unique metric path creates a Whisper file. Very high cardinality (millions of metrics) requires SSD storage and careful carbon-relay sharding.
Q: Can I use Grafana with Graphite? A: Yes. Grafana has a built-in Graphite data source that supports the full render API and function set.
Q: What is the difference between Graphite and StatsD? A: StatsD aggregates application metrics (counters, timers) and flushes summaries to Graphite for storage and visualization. They are complementary.