Code Monkey home page Code Monkey logo

metronome's Introduction

metronome

Mini-graphite that uses client-side java script to render graphs w/o depending on graphite.

'metronome' implements the carbon protocol, so anything that can feed Graphite can feed metronome. We also accept submissions via POST:

For example, to submit RX bytes for eth0:

while true;
do
    VAL=$(ip -s link ls eth0 | grep RX -A 1 | tail -1 | awk '{print $1}')
    wget -q --post-data="" "http://127.0.0.1:8000/?do=store&name=rxbytes&timestamp=$(date +%s)&value=$VAL" -O /dev/null
    sleep 1
done

To retrieve data:

$ wget http://127.0.0.1:8000/?do=retrieve&name=rxbytes&begin=0&end=$(date +%s)&callback=jsonp

This delivers a JSONP callback with your values in there.

To view, try html/index.html

Installing

Dependencies include a recent g++ (4.7+), Boost and libeigen.

Installing Eigen

Either install libeigen3-dev (Debian, Ubuntu), eigen3-devel (Fedora, EPEL).

To install it manually:

$ wget http://bitbucket.org/eigen/eigen/get/3.2.1.tar.bz2
$ tar xf 3.2.1.tar.bz2

Compiling

$ ./bootstrap
$ ./configure
$ make

If you installed libeigen manually, use ./configure --with-eigen=/path/to/eigen

Running

$ mkdir stats
$ ./metronome --stats-directory=./stats

Next, host the 'html/' directory somewhere on a webserver, and edit 'html/local.js' so it knows the Webserver IP address of metronome (port 8000 on :: by default).

Thanks to

Aki Tuomi for the excellent yahttp, Rickshaw for the graphs. Eigen for the math. And a cast of thousands for C++2011.

status

"Toy" for now - stores all data in flat files, which we read in their entirety to replay data.

But, starting to look nice.

metronome's People

Contributors

ahupowerdns avatar cmouse avatar crami avatar ekohl avatar gintsgints avatar habbie avatar mind04 avatar nlmark avatar paddg avatar pieterlexis avatar rgacogne avatar wojas avatar zeha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metronome's Issues

add <optgroup> to #server dropbox to sort different clusters

I already fiddled with the code, but so far I'm too successful, however; I wish to be able to sort servers in the dropbox overview, using the <optgroup> tag.
People may like to order based on node-location or function (auth/rslv) or whatever.

It will be close to impossible to program matches on hostname, but maybe it's possible to make a default <optgroup> + allow to define custom ones, and have a key/value list of known hosts, which would place them correctly in the generated HTML.

our interpolation is stupid

Current interpolation & derivative stuff is nice, but stupid. It would be better to generate the derivative from the cspline. We deal badly with missing data now

metronome1.powerdns.com fails to load the first time

Most of the time when I try and load metronome1.powerdns.com with a cold browser cache I get a Javascript error and have to refresh the page.

The error message:
metronome

After dismissing the error the page loads slightly further but no graphs are visible. A refresh fixes the problem.

Observed on Chromium (latest) on various machines all running Debian Stable x86_64.

We crash on a well timed socket error

Launched Carbon functionality on [::]:2003
Launched webserver on [::]:8000
a

p^@exception: Error reading from socket: Connection reset by peer
terminate called after throwing an instance of 'std::runtime_error'
what(): failed in writen2: Broken pipe
Aborted

All graph: include dnsdist somehow?

If you're using dnsdist to frontend various backend powerdns recursors, then you've got a dnsdist queries value thats not being graphed on "All". At the moment the callback for the All graph only includes powerdns servers' queries and servfails. It would be nice to have dnsdist query metrics represented on that All graph somehow in that scenario.

multitenancy

Support users/groups, either by making it easy to run multiple metronomes, or writing actual code.

missing pickle port

carbon-relay sends data only over pickle protocol, metronome only accepts plaintext

404 File not found

Hi,

I have an issue after installing with git clone and did turn on the server, am having: 404 File not found

is there any other configuration? that I need to do

local.js edited and same issue.

Debian Package overwrites my local changes in /usr/share/metronome/html/local.js

I have local changes in /usr/share/metronome/html/local.js namely
"use strict"; var metronomeServer="/metronome-data/";
to host it behind a reverse proxy but it seems that the debian package update overwrites it to its default.

hi metronome 0.9.0+52.g877231f0d-1pdns.stretch amd64 mini-graphite with builtin webserver and client-side plotting

The Debian way would be to make it a symlink to /etc i suppose. Any chance of mitigating this?

thank you,

Stefan

Can't build on ubuntu server 18

ubuntu@ip-172-16-1-219:~/metronome-master$ ./bootstrap
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
sh: 1: builder/gen-version: not found
configure.ac:3: error: AC_INIT should be called with package and version arguments
/usr/share/aclocal-1.15/init.m4:29: AM_INIT_AUTOMAKE is expanded from...
configure.ac:3: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

I seem to have all the listed dependencies. What am I missing?

Stack - All

Is it possible to easily modify the code to output a stacked graph, showing each of the individual pdns instances on a single graph instead of the sum?

hits process limit

metronome forks a connection for each carbon connection, which often seem to never close (had over 600 threads running for 3 pdns sources)

also it reads only single bytes from network due to unbuffered line reading (check with strace).

does not answer to http requests on port 8000 when daemonized

metronome does not seem to be responding to or even receiving packets on port [::]:8000 when daemonized.

When started via

$ ./metronome --daemon=0 --stats-directory=./stats
Launched Carbon functionality on [::]:2003
Launched webserver on [::]:8000

it works as advertised.

some graphs may only have one data reference point

In one graph showing percentage CPU use, there was only one number, 50%, plotted on the vertical axis. With only one number it's hard to know the scale of the graph. It could be drastic or it could be minor and the user would have no way to know what the scale is.

Thanks

Return null for non-existent datapoints

When querying a data range for which metronome has no data, it should return null values instead of 0. Currently it's not possible to distinguish between missing data and data that is simply 0.

Care must be taken to not break the current graphs with such a change.

To test, pick an end time in the future.

Plain JSON support instead of always JSONP

Currently the metronome API only supports JSONP, which wraps the data in a function call. This makes it harder to consume from other code.

When the callback argument is not present or empty, it should return plain JSON instead with Content-Type: application/json.

Additionally, the data returned by the retrieve call is invalid JSON (but valid Javascript, so browser JSONP calls work): raw and derivative need to be wrapped in double quotes.

please reinstate `make check`

Uncomming the bottom of Makefile.am makes make check work for me, but we actually need some autoconf/automake changes to correctly detect the relevant Boost lib, make the files show up in make dist, etc.

All overview not working

The overview "All" on metronome1 sees to be broken. I could verify this but it first worked until I got more and more servers into my own metronome. There are absolutly no broken data files in my own metronome.
Could please fix this issue.

It seems that 24 servers is the magical number if you add the 25. server it is broken.

unable to install

when I run make I get the following error message:

#make
g++ -Wall -O3 -ggdb -I. -I yahttp/yahttp -pthread -MMD -MP -DYAHTTP_MAX_URL_LENGTH=16384 -std=gnu++0x -c -o metronome.o metronome.cc
In file included from metronome.cc:1:0:
yahttp/yahttp/yahttp.hpp:12:27: fatal error: yahttp-config.h: No such file or directory
#include "yahttp-config.h"
^
compilation terminated.
make: *** [metronome.o] Error 1

Display error message on metronome connection failure

Would be nice to show some sort of error message in the HTML/JS files when the connection to the metronome server fails or runs into a timeout.

Kept wondering why a white page without any content seems to be interesting for everyone else (who doesn't have port 8000 blocked outbound) ;)

html: allow to specify the external ip address of the metronome server

Currently, at the bottom of the metronome html web-page it is hard-coded the string below

Built with Metronome. You are most cordially invited to add your own PowerDNS instances to this "graph as a service". It can be as easy as setting: carbon-server=82.94.213.34, or at runtime: rec_control set-carbon-server 82.94.213.34

It would be great to provide a way through the local.js file to

  • customize the content of the string
  • specify an external-address variable to replace the currently hardcoded 82.94.213.34 IP address

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.