Skip to main content
grafilter
=========

Dashboards like [Grafana](http://grafana.org) are awesome, but sometimes they make it hard to look at all the metrics, without first spending time to configure a dashboard. Grafilter is meant to provide lightweight and easy access to your metrics. You can still customize visuals of course, but in a way that let's you store these customizations in a versioned config management system such as [Ansible](http://www.ansible.com), [BundleWrap](http://bundlewrap.org) or [Chef](https://www.chef.io/chef/) as opposed to a database like Grafana 2 does.

Grafilter supports InfluxDB 0.9.0 and onwards.

![PyPI downloads](http://img.shields.io/pypi/dm/grafilter.svg)   ![PyPI version](http://img.shields.io/pypi/v/grafilter.svg)   ![Python 3.x](http://img.shields.io/badge/Python-3.4-green.svg)   ![License](http://img.shields.io/badge/License-GPLv3-red.svg)

Install
-------

```
apt-get install python3-pip
pip3 install grafilter
```

Configure
---------

Create a file with these contents anywhere:

```python
CACHE_TIMEOUT = 300
CONFIG_DIR = "/var/lib/grafilter"
DEBUG = False
IGNORED_TAGS = ["_id"]
INFLUXDB_DB = "metrics"
INFLUXDB_URL = "http://user:pass@influxdb.example.com:8086"
```

Note that `INFLUXDB_URL` points to the HTTP API port of InfluxDB.

Run
---

```sh
GRAFILTER_SETTINGS=/path/to/grafilter.cfg grafilter
```

Customize
---------

You can customize the appearance of your individual metrics by placing files in the `metrics` subdirectory of your `CONFIG_DIR`. These files must have a `.json` extension and look like this:

```json
{
"pattern": "\\.load$",
"transform": "lambda x: math.floor(x)",
"type": "area"
}
```

Note that `pattern` is a regular expression that has to match the name of the metrics you want to customize. Each metric will only be styled according to the first file with a matching `pattern`. All other options listed here are optional.

Option | Explanation
-------|------------
`max` | force highest value on y axis (int or float)
`min` | force lowest value on y axis (int or float)
`short_name` | a cosmetic name for this metric, e.g. "Load Average"
`transform` | a Python expression describing a function that takes a numeric value and returns another. It can be used to perform conversions and other math on your metrics. You have access to the [math module from the Python standard library](https://docs.python.org/3/library/math.html).
`type` | chart type: `area`, `area-spline`, `area-step`, `line`, `spline` or `step` (defaults to `line`)
`unit_format` | a [d3 format specifier](https://github.com/mbostock/d3/wiki/Formatting#d3_format) for your y axis (e.g. "s" to turn "1000" into "1K" and "1000000" into "1M")
`unit` | any string you want to be displayed next to your y axis

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grafilter-0.2.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grafilter-0.2.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file grafilter-0.2.1.tar.gz.

File metadata

  • Download URL: grafilter-0.2.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for grafilter-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0b19ff54dde11d90031ac68030e31cf7fce991fe9a7796bba8823ccf281a7749
MD5 304a778825b09b852a422ce889c2a9a0
BLAKE2b-256 4f48e916ba6db12b4940654ffb951ecf126c71aeb50a8a42239ecf5cc6d8c06e

See more details on using hashes here.

File details

Details for the file grafilter-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for grafilter-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d39bf8badfb7869a350b72b7990ec0449cbb5722d84d456a4f39bc9a32d8f694
MD5 252da3abbd3e0c57207ed2153c6f0714
BLAKE2b-256 242341c4d3e5d0926c6d2ffbfde76119c4484cceda30dc9dc091b245e8d0a541

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 files

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page