Store metrics in InfluxDB.
There's currently one plugin included with Timera, httptimer.
With httptimer, you can store the time it takes to get http responses. For example:
[httptimer_plugin_01]
name = www.google.com
url = https://www.google.com/
proxy = http://proxy.example.com:3128/
include_direct = trueSee the config file, config.ini, for options.
Use any InfluxDB-compatible visualization software to view your metrics. For example:
Timera has a simple plugin system. So it's easy to write your own plugin to collect and store the metrics you want. See the custom plugin below and the included plugin httptimer for examples.
config.ini:
[mymetrics_plugin_01]
plugin_import = mymetrics.metrics
name = cpu_load_short
field = valuemymetrics/metrics.py:
import logging
import timera
log = logging.getLogger(__name__)
def get_metrics(config, timestamp, plugin):
"""
:param config: ConfigParser instance
:param timestamp: unix timestamp (seconds since epoch) for current collection interval
:param plugin: dict with parsed plugin values
"""
measurement = plugin['config']['name']
field = plugin['config']['field']
metric = 0.64
fields = {field: str(metric)}
tags = {'host': 'server01', 'region': 'us-west'}
log.info('%s %r: %s=%f' % (measurement, tags, field, metric))
measurementd = dict(measurement=measurement, time=timestamp, fields=fields, tags=tags)
idbc = timera.db.get_client(config)
timera.db.write_points(idbc, [measurementd])If you create a plugin you think others would find useful, please submit a PR with tests for inclusion in Timera.
$ pip install timeraOr if using a virtual environment:
$ source env/bin/activate
$ pip install timeraUse make install-dev to install in editable mode (pip install -e .) with pytest and tox:
$ source env/bin/activate
$ cd timera-master
$ make install-dev
$ make test
$ toxCreate db and start collecting metrics:
# edit config.ini
$ timera config.ini reset_db
$ timera config.ini startUse Supervisor to run Timera. See the
contrib dir. Supervisor requires
Python 2 (pip install supervisor).
Configure InfluxDB as a datasource.
For the httptimer plugin, create a graph panel and
configure the query:
See CHANGES.rst.
Timera is provided under the MIT License. See LICENSE.txt.

