README

Carbonapi

Build Status Go Report Card codecov

Carbonapi is a Go-based Graphite frontend. It provides two binaries, carbonapi and carbonzipper, that unify responses from multiple Graphite backends and provide math and graphing functions.

This project is run in production at Booking.com. We are in the process of documenting its installation and setup, but can answer any questions that interested persons have.

CarbonAPI supports a significant subset of graphite functions; see COMPATIBILITY. In our testing it has shown to be 5x-10x faster than requesting data from graphite-web.

Build

To build both the carbonapi and carbonzipper binaries, run:

make

To build the binaries with debug symbols, run:

make debug

We do not provide packages for install at this time. Contact us if you're interested in those.

Run

You can easily run the program with sample config provided in config/ directory by running ./run.sh.

Requirements

We recommend using at least version 1.10 of Go. Booking.com builds its binaries with the latest stable release of Go at any time. The binaries likely compile on older versions of Go (at least 1.9), but we don't test the build against them because of problems with computing test coverage of the whole project.

At the moment, we only guarantee that Carbonapi can talk to the go-carbon Graphite store. We are interested in supporting other stores.

OSX Build Notes

Some additional steps may be needed to build carbonapi with cairo rendering on MacOSX.

Install cairo:

brew install Caskroom/cask/xquartz

brew install cairo --with-x11

Acknowledgement and history

This program was originally developed for Booking.com. With approval from Booking.com, the code was generalised and published as Open Source on GitHub, for which the author would like to express his gratitude.

This is Booking.com's fork of go-graphite/carbonapi. That project's current performance characteristics are not sufficient for our production needs, and we decided it had moved too far ahead for us to be able to improve them effectively. We thus reverted back to versions 0.9.2 of carbonapi and 0.74 of carbonzipper, and are moving more slowly in the same direction as the original project.

License

This code is licensed under the BSD-2 license.

Expand ▾ Collapse ▴

Directories

Path Synopsis
app/carbonapi
app/carbonzipper
cache
carbonapipb
cfg
cmd/carbonapi
cmd/carbonzipper
date
expr
expr/functions
expr/functions/absolute
expr/functions/alias
expr/functions/aliasByMetric
expr/functions/aliasByNode
expr/functions/aliasSub
expr/functions/asPercent
expr/functions/averageSeries
expr/functions/averageSeriesWithWildcards
expr/functions/below
expr/functions/cactiStyle
expr/functions/cairo
expr/functions/cairo/png
expr/functions/changed
expr/functions/consolidateBy
expr/functions/constantLine
expr/functions/countSeries
expr/functions/cumulative
expr/functions/delay
expr/functions/derivative
expr/functions/diffSeries
expr/functions/divideSeries
expr/functions/ewma
expr/functions/example
expr/functions/exclude
expr/functions/fallbackSeries
expr/functions/fft
expr/functions/graphiteWeb
expr/functions/grep
expr/functions/group
expr/functions/groupByNode
expr/functions/highest
expr/functions/hitcount
expr/functions/holtWintersAberration
expr/functions/holtWintersConfidenceBands
expr/functions/holtWintersForecast
expr/functions/ifft
expr/functions/integral
expr/functions/invert
expr/functions/isNotNull
expr/functions/keepLastValue
expr/functions/kolmogorovSmirnovTest2
expr/functions/legendValue
expr/functions/limit
expr/functions/linearRegression
expr/functions/logarithm
expr/functions/lowPass
expr/functions/lowest
expr/functions/mapSeries
expr/functions/minMax
expr/functions/mostDeviant
expr/functions/moving
expr/functions/movingMedian
expr/functions/multiplySeries
expr/functions/multiplySeriesWithWildcards
expr/functions/nPercentile
expr/functions/nonNegativeDerivative
expr/functions/offset
expr/functions/offsetToZero
expr/functions/pearson
expr/functions/pearsonClosest
expr/functions/perSecond
expr/functions/percentileOfSeries
expr/functions/polyfit
expr/functions/pow
expr/functions/randomWalk
expr/functions/rangeOfSeries
expr/functions/reduce
expr/functions/removeBelowSeries
expr/functions/removeEmptySeries
expr/functions/scale
expr/functions/scaleToSeconds
expr/functions/seriesList
expr/functions/sortBy
expr/functions/sortByName
expr/functions/squareRoot
expr/functions/stddevSeries
expr/functions/stdev
expr/functions/substr
expr/functions/sum
expr/functions/sumSeriesWithWildcards
expr/functions/summarize
expr/functions/timeFunction
expr/functions/timeShift
expr/functions/timeStack
expr/functions/transformNull
expr/functions/tukey
expr/helper
expr/holtwinters
expr/interfaces
expr/metadata
expr/rewrite
expr/rewrite/applyByNode
expr/types
intervalset
limiter
mstats
pathcache
pkg/backend Package backend defines an interface and RPC methods for communication with Graphite backends.
pkg/backend/mock Package mock defines a mock backend for testing.
pkg/backend/net Package net implements a backend that communicates over a network.
pkg/parser
pkg/types Package types defines the main Graphite types we use internally.
pkg/types/encoding/carbonapi_v2 Package carbonapi_v2 defines encoding and decoding methods for Find, Info and Render responses.
pkg/types/encoding/json Package json defines encoding and decoding methods for Find, Info and Render responses.
pkg/types/encoding/pickle Package pickle defines encoding methods for Find and Render responses.
tests
util Package util provides UUIDs for CarbonAPI and CarbonZipper HTTP requests.