GithubHelp home page GithubHelp logo

lyr / carbonapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bookingcom/carbonapi

0.0 1.0 0.0 18.15 MB

High performance Graphite frontend in go

License: Other

Makefile 0.13% Go 98.52% TSQL 0.10% Dockerfile 0.12% Shell 0.32% Python 0.81%

carbonapi's Introduction

Carbonapi

Build Status Go Report Card codecov gitter

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

Note: build process might require pkg-config to be installed:

Mac OS X

find pkg-config version on you want to install and run script below with replaced "VERSION_TO_INSTALL":

PKG_CONFIG_VERSION="VERSION_TO_INSTALL" bash -c 'curl https://pkgconfig.freedesktop.org/releases/pkg-config-$PKG_CONFIG_VERSION.tar.gz -o pkgconfig.tgz'
mkdir pkg-config && tar -zxf pkgconfig.tgz -C pkg-config --strip-components 1 && cd pkg-config

There is a circular dependency between pkg-config and glib. To break it, pkg-config includes a version of glib, which is enough to break the dependency cycle and compile it with --with-internal-glib key:

env LDFLAGS="-framework CoreFoundation -framework Carbon" ./configure --with-internal-glib && make install

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

Run

Run the full stack carbonapi -> zipper -> go-carbon with:

docker-compose up

You can feed in sample data with:

echo "test.test 5 `date +%s`" | nc -c localhost 2003

and get it back with:

curl 'http://localhost:8081/render?target=test.test&format=json&from=-10m'

Requirements

We officially support go 1.12. Booking.com builds its binaries with the latest stable release of Go at any time.

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

Xquartz is a required dependency for cairo.

Backend support

go-carbon

The main supported backend is go-carbon Graphite store.

Clickhouse

Clickhouse support is experimental.

The pair carbonapi and carbonzipper works with Clickhouse via graphite-clickhouse.

The access chain then looks like this:

carbonapi -> zipper -> graphite-clickhouse -> clickhouse

(this presumes the data was written into Clickhouse with carbon-clickhouse).

Run

docker-compose --file docker-compose-clickhouse.yaml up

to get the setup up and running in several Docker containers.

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.

carbonapi's People

Contributors

arodland avatar avereha avatar azhiltsov avatar borovskyav avatar cashlo avatar civil avatar cldellow avatar ctrlok avatar deniszh avatar dgryski avatar dieterbe avatar gksinghjsr avatar gothrek22 avatar grzkv avatar gysinghb avatar ibuclaw avatar jaderdias avatar kamaev avatar kanatohodets avatar kerrick-lyft avatar korservick avatar lomik avatar mbarbon avatar msaf1980 avatar nnuss avatar oriordan avatar reyjrar avatar szibis avatar vision-sbm avatar zimathias avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.