Export logs from ringserver as influxdb timeseries
Project description
ringserverstats
Installation
ringserverstats is distributed on PyPI <https://pypi.org>
_ as a universal
wheel.
$ pip install ringserverstats
Influxdb configuration
This program will fill 2 measurements. You should configure a database for these, and configure a user with write priviledges.
Prepare database
First, create a database, a user, and retention policie.
create database ringserverdb
create user ringserver with password 'ringserverer'
grant write on ringserverdb to ringserver
grant read on ringserverdb to ringserver
create retention policy rp_ringserverevents on ringserver duration 1w replication 1
create retention policy rp_ringserverstats on ringserver duration 520w replication 1
Usage
To work properly, this program needs the following environment variables set :
INFLUXDB_HOST
: The host name or adress of influxdb serverINFLUXDB_PORT
: The port number of influxdb serverINFLUXDB_USER
: The influxdb user to authenticate toINFLUXDB_PASS
: The password to authenticate withINFLUXDB_DB
: The database name containing the metricINFLUXDB_VERIFY_SSL
: Set toyes
orno
to verify SSL connectionINFLUXDB_SSL
: Should the connection go to https ?
$ python ringserstats 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.
Used tags in influxdb :
show tag keys from ringserverevents
show tag keys from ringserverstats
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)
Because storing events in the longterm is not very relevant, the ringserverstats
measurement groups all events by day, by host and by network.
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.
Source Distribution
Built Distribution
Hashes for ringserverstats-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37a0c0806bcd9e71b36f2f2dc462ad16a5ecbfd64cec18fbd60c7ad81ab8dafa |
|
MD5 | 11323451e706be22d3d57dc452dff867 |
|
BLAKE2b-256 | f27abb46872a4a189915f920e388f76d2cdb9bd17775f1000234381532f50f21 |