vimeo / graph-explorer

A graphite dashboard powered by structured metrics
http://vimeo.github.io/graph-explorer/
Apache License 2.0
1.06k stars 93 forks source link

Graph explorer

A highly interactive dashboard to satisfy varying ad-hoc information needs across a multitude of metrics in a very powerful way:

The graphs themselves support annotated events and are also interactive because it uses timeserieswidget Furthermore, we aim for minimal, hackable code and as simple as possible deploy/install.

Screenshot

It also has:

Learn the basics

Metrics 2.0

In graphite, a metric has a name and a corresponding time series of values. Graph-explorer's metrics are structured: they contain key-value tags that describe all their attributes, the unit, the metric type, etc. You can generate the tag database by using plugins that parse metrics using regular expressions, or by tagging them as they flow into graphite. See the Structured Metrics page

GEQL, the Graph-Explorer Query Language

the Graph-Explorer Query Language is designed to:

At the most basic level you start by typing patterns that will filter out the metrics you're looking for. Then, you can extend the query by typing statements that have special meanings.

For more information see the Graph-Explorer Query Language page

Dependencies

Installation

Using docker

you can easily use docker and the vimeo/graph-explorer docker image. Follow the instructions there

Via operating system packages

not sure which distros have graph-explorer packages. TBA.

Via python

There's two ways to go about this, from source and via pypi (see below).

But first an optional, though recommended step. Using virtualenv, you can install all packages in an isolated directory, so that you never have issues with conflicting library versions, conflicts with packages from other package managers, you can easily remove the install, etc.

path=/where/do/you/want/to/install  # this can be anywhere
virtualenv $path
source $path/bin/activate

The actual installation takes care of all dependencies and works the same whether you use virtualenv or not. See below for either the pypi or the git source approach.

From pypi

Pypi is the python package repository.

pip install graph-explorer

From source

Get a code checkout, initialize all git submodules and go in the directory, like so:

git clone --recursive https://github.com/vimeo/graph-explorer.git && cd graph-explorer

This will give you the latest bleeding edge code (master branch), which may be buggy. You can switch to the latest stable release with git checkout v<version>

The releases page has more info, but don't download from there, the downloads don't contain the needed submodules! Graph Explorer version numbering is based on semver.

Install:

python setup.py install

Instead of that, if you want to hack on Graph-Explorer, you can run.

python setup.py develop

This is like an installation, but it links back to the code. So when you run graph-explorer, it will automatically reload the server when you modify any python file, and changes in assets (js, css, ...) are visible for new requests. Templates however are cached by bottle and still need a manual restart for changes to become effective.

Configuration of graph-explorer

Configuration of graphite server

you'll need a small tweak to allow this app to request data from graphite. For apache2 this works:

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, OPTIONS, POST"
Header set Access-Control-Allow-Headers "origin, authorization, accept"

Running

Make sure Graph-Explorer can write to the directories that you configured the log (and if enabled, alerting database file) to be in.

Linux / Unix

run_graph_explorer.py my_config_file.cfg and your page is available at <ip>:8080

Windows

python %VIRTUAL_ENV%\scripts\run_graph_explorer.py my_config_file.cfg and your page is available at <ip>:8080

or with Powershell:

python $env:VIRTUAL_ENV/scripts/run_graph_explorer.py my_config_file.cfg

Troubleshooting

first check in the top section if there are target matching and 'total graphs' is > 0.
if not, your query expression might be too restricting, or maybe it didn't find your metrics from metrics.json (see 'targets matching: x/total')
if yes, check for any errors in the javascript console, (in firefox you need firebug, in chrome and such 'tools->javascript console')

also check all network requests in the network tab, and make sure they return http 200 or 304 especially, check that the http requests to graphite/render/?<...> return actual data. you may be suffering from this graphite bug or this graphite bug or maybe your graphite version is too old.

see section 'Configuration of graphite server' above

This is because graphite doesn't support consolidation on its data API yet.

Documentation

wiki page

Unit tests

python setup.py test

Getting in touch