Export logs from ringserver as postgresql timeseries
Project description
ringserverstats
Parse ringserver reports, compute statistics and store in influxdb.
Installation
ringserverstats is distributed on PyPI https://pypi.org as a universal wheel.
$ pip install ringserverstats
Postgresql preparation
CREATE ROLE resifstats WITH LOGIN PASSWORD 'md5xxxxxxxxxx';
CRATE DATABASE resifstats OWNER resifstats;
\c resifstats
CREATE EXTENSION timescaledb
Then go for the migrations :
$ yoyo apply --database postgresql://resifstats@resif-pgdev.u-ga.fr:5433/resifstats -m migrations
Usage
To work properly, this program needs the following environment variables set :
DBHOST
: The host name or adress of influxdb serverDBPORT
: The port number of influxdb serverDBUSER
: The influxdb user to authenticate toDBPASS
: The password to authenticate withDBNAME
: The database name containing the metric
$ ringserverstats txlogs.log
Explanations
The TX logs from ringserver are metrics suitable for a timeserie database. The idea is to parse the logs, as in the exemple below, and to generate values to insert into an influxdb timeseries database.
The file grafana-dashboard.json
can be imported into grafana to visualize this timeserie.
Events
The ringserverevents measure has several tags :
- network, station, location, channel : which data was requested
- geohash : location of the client in geohash format
- hosthash : a hash of the client ip (usefull to correlate the clients requests)
- city : an english city name
Grouping and downsampling
To achieve downsampling, we use timescaledb's continuous query.
License
ringserverstats
is distributed under the terms of the GPL v3 or later. See LICENSE file.
Build
python3 setup.py sdist bdist_wheel
Test
tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.