skbkontur/carbonapi

Name: carbonapi

Owner: Kontur

Description: API server for github.com/go-graphite/carbonzipper

Forked from: go-graphite/carbonapi

Created: 2017-09-11 10:06:01.0

Updated: 2017-09-11 10:06:03.0

Pushed: 2018-02-12 08:13:28.0

Homepage:

Size: 16126

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

carbonapi: replacement graphite API server

Build Status GoDoc PR Stats Issues Stats

We are using Private Maven, RPM, DEB, PyPi and RubyGem Repository | packagecloud to host our packages!

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.

For requirements see Requirements section below.

Installation

At this moment we are building packages for CentOS 6, CentOS 7, Ubuntu 14.04 and Ubuntu 16.04. Installation guides are available on packagecloud (see the links below).

Stable versions: Stable repo

Autobuilds (master, might be unstable): Autobuild repo

General information

Carbonzipper can be configured by environment variables or by config file. For an example see carbonapi.example.yaml

$ ./carbonapi -config /etc/carbonapi.yaml

Request metrics will be dumped to graphite if coresponding config options are set, or if the GRAPHITEHOST/GRAPHITEPORT environment variables are found.

Request data will be stored in memory (default) or in memcache.

Configuration by environment variables

Every parameter in config file are mapped to environment variable. I.E.

urency: 20
e:
 Type of caching. Valid: "mem", "memcache", "null"
ype: "mem"
reams:
backends:
    - "http://10.0.0.1:8080"
    - "http://10.0.0.2:8080"

That config can be replaced by

URENCY=20
E_TYPE=mem
REAMS_BACKENDS="http://10.0.0.1:8080 http://10.0.0.2:8080"

You should be only aware of logging: because carbonapi support a list of logger, env variables will replace only first logger.

If you apply variable LOGGER_FILE=stdout to config:

er:
- logger: ""
  file: "stderr"
  level: "debug"
  encoding: "console"
  encodingTime: "iso8601"
  encodingDuration: "seconds"
- logger: ""
  file: "carbonapi.log"
  level: "info"
  encoding: "json"

it will be equal to config:

er:
- logger: ""
  file: "stdout" # Changed only here
  level: "debug"
  encoding: "console"
  encodingTime: "iso8601"
  encodingDuration: "seconds"
- logger: ""
  file: "carbonapi.log" # Not changed
  level: "info"
  encoding: "json"
Requirements

You need to have Go >= 1.8 to build carbonapi from sources. Building with Go 1.7 is not supported for versions >0.8.0

CarbonAPI uses protobuf-based protocol to talk with underlying storages. For current version the compatibility list is:

  1. carbonzipper >= 0.50
  2. go-carbon >= 0.9.0 (Note: you need to enable carbonserver in go-carbon).
  3. carbonserver@master (Note: you should probably switch to go-carbon in that case).
  4. graphite-clickhouse any. That's alternative storage that doesn't use Whisper.
  5. carbonapi >= 0.5. Note: starting from carbonapi 3596e9647611e1f833a911d663747271623ec003 (post 0.8) carbonapi can be used as a zipper's replacement
OSX Build Notes

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

Install cairo:

ew install Caskroom/cask/xquartz

ew install cairo --with-x11
Acknowledgement

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.

License

This code is licensed under the BSD-2 license.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.