Pour remplacer graphite-web (django) par plus léger
Ça c'est une très bonne nouvelle !
TIL :
#
#
#
export CFLAGS="-I$HOME/include -I$HOME/include/python2.7"
export CPPFLAGS="-I$HOME/include -I$HOME/include/python2.7"
export PKG_CONFIG_PATH="$HOME/lib/pkgconfig"
export LDFLAGS="-L$HOME/lib -L$HOME/lib/python2.7"
export LD_LIBRARY_PATH="$HOME/lib:$HOME/lib/python2.7:$HOME/lib/python2.7/site-packages/cairo"
export PYTHONPATH="$HOME/lib/python:$HOME/lib/python2.7/site-packages:$HOME/.local/bin/usr/local/lib/python2.7/site-packages"
export PATH="$HOME/.local/bin:$PATH"
cd $HOME/graphite-install
wget http://zlib.net/zlib-1.2.8.tar.gz
wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.6.2.tar.gz
wget http://www.sqlite.org/2013/sqlite-autoconf-3071700.tar.gz
tar zxf zlib-1.2.8.tar.gz
tar zxf libpng-1.6.2.tar.gz
tar zxf sqlite-autoconf-3071700.tar.gz
cd zlib-1.2.8
./configure --prefix=$HOME
make
make install
cd ../libpng-1.6.2
./configure --prefix=$HOME
make
make install
cd ../sqlite-autoconf-3071700.tar.gz
./configure --prefix=$HOME
make
make install
cd $HOME/graphite-install
wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar zxf Python-2.7.5.tgz
cd Python-2.7.5
./configure --enable-shared --prefix=$HOME
make
make install
cd $HOME/graphite-install
wget http://cairographics.org/releases/pixman-0.26.2.tar.gz
wget ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gz
wget http://ftp.gnome.org/pub/GNOME/sources/glib/2.31/glib-2.31.22.tar.xz
wget http://cairographics.org/releases/cairo-1.12.2.tar.xz
wget http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
tar xzf pixman-0.26.2.tar.gz
tar xzf libffi-3.0.11.tar.gz
unxz glib-2.31.22.tar.xz
unxz cairo-1.12.2.tar.xz
tar xjf py2cairo-1.10.0.tar.bz2
cd libffi-3.0.11
./configure --prefix=$HOME
make
make install
cd ../glib-2.31.22
./configure --prefix=$HOME
make
make install
cd ../pixman-0.26.2
./configure --prefix=$HOME
make
make install
cd ../cairo-1.12.2
./configure --prefix=$HOME
make
make install
cd ../py2cairo-1.10.0
~/bin/python ./waf configure --prefix=$HOME
~/bin/python ./waf build
~/bin/python ./waf install
~/bin/python -c 'import cairo; print cairo.version'
cd $HOME/graphite-install
wget https://django-tagging.googlecode.com/files/django-tagging-0.3.1.tar.gz
wget https://www.djangoproject.com/m/releases/1.5/Django-1.5.1.tar.gz
wget https://pypi.python.org/packages/source/z/zope.interface/zope.interface-4.0.5.zip#md5=caf26025ae1b02da124a58340e423dfe
wget http://twistedmatrix.com/Releases/Twisted/11.1/Twisted-11.1.0.tar.bz2
unzip zope.interface-4.0.5.zip
tar zxf django-tagging-0.3.1.tar.gz
tar zxf Django-1.5.1.tar.gz
tar jxf Twisted-11.1.0.tar.bz2
cd zope.interface-4.0.5
~/bin/python setup.py install --user
cd ../Django-1.5.1
~/bin/python setup.py install --user
cd ../django-tagging-0.3.1
~/bin/python setup.py install --user
cd ../Twisted-11.1.0
~/bin/python setup.py install --user
cd $HOME/graphite-install
wget https://launchpad.net/graphite/0.9/0.9.10/+download/graphite-web-0.9.10.tar.gz
wget https://launchpad.net/graphite/0.9/0.9.10/+download/carbon-0.9.10.tar.gz
wget https://launchpad.net/graphite/0.9/0.9.10/+download/whisper-0.9.10.tar.gz
tar -zxvf graphite-web-0.9.10.tar.gz
tar -zxvf carbon-0.9.10.tar.gz
tar -zxvf whisper-0.9.10.tar.gz
cd whisper-0.9.10
~/bin/python setup.py install --home=$HOME/graphite
cd ../carbon-0.9.10
~/bin/python setup.py install --home=$HOME/graphite
cd ../graphite-web-0.9.10
~/bin/python check-dependencies.py
~/bin/python setup.py install --home=$HOME/graphite
cd $HOME/graphite/conf
cp carbon.conf.example carbon.conf
cp storage-schemas.conf.example storage-schemas.conf
vim storage-schemas.conf
cd $HOME/graphite/lib/python/graphite
cp local_settings.py.example local_settings.py
vim local_settings.py
~/bin/python manage.py syncdb
cd $HOME/graphite
~/bin/python carbon-cache.py status
~/bin/python carbon-cache.py start
screen
~/bin/python manage.py runserver
curl localhost:8000
cd $HOME/graphite/examples
~/bin/python example-client.py
curl -X POST "http://localhost/events/" -d '{"what": "Web Service", "tags": "production deploy", "data":"version 1.1.7"}'
On envoie une valeur aléatoire toutes les 10 secondes et on observe le résultat sur un dashboard grafana qui se refresh tout seul toutes les 10 secondes ;-)
for i in {1..60}; do line=$(echo "toto $(( ( RANDOM % 10 ) + 1 )) $(date +%s)"); echo $line; echo $line | nc -q0 localhost 2003; sleep 10; done
La base de la métrologie avec les différents types de metric : gauge, rate, histogram.. Le rôle de statsd (buffer..)
cd /opt/graphite/storage/whisper
find . -name "*.wsp" | xargs -I {} sh -c "echo -n '{} ' ; whisper-info.py {}|grep aggre|cut -d' ' -f2" > aggreg.dump
82024 average
2784 max
1378 min
8732 sum
59682 average
Donc oui, tous les whispers collectd sont en average.
Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister
used by Doo 1M metric/sec (12 CPU)
Scaling graphite
via arnaudb
[07:27] < torkelo>| matejz: I have managed to get about 140~ bytes per measurement (ES) asyd
[07:27] < matejz>| and was thinking of using it for metrics as well aviau
[07:27] < torkelo>| which is 12x the size requirement of Graphite (12 bytes per measurement)
[10:16] < torkelo> | agree, if you store more than 100 000 metrics/s I think ES is not a good option. But for short term performance logging the new metric features for flat_white
percentile and moving average, etc are looking very good
Un get la dessus : /api/datasources/proxy/1/metrics/find/?query=collectd.*