A tool for generating compliance reports based on Telemeter data.
Project description
telemeter-reporter
Python tool for generating SLA compliance reports based on Telemeter data.
For the original prototype script, see the notebook
directory.
Installation
Install with pip
(Python 3 only)
pip3 install telemeter-reporter
Usage
Configuration
Configuration is typically provided with via a YAML file. By default, the command line tool looks for a
.telemeter-reporter.yml
under $HOME
. Alternatively, you can specify the path to the config file with the -c
flag.
A sample config file is provided (reporter_confg.yml.tmpl
). An explanation of each key is below:
css
: provide a Cascading Style Sheet here to be injected into HTML-formatted reports.api:telemeter:url
: URL to any service providing a Prometheus-compatible APIapi:telemeter:token
: Log-in token for the Telemeter API (i.e. OAuth)api:uhc:url
: URL for the UHC HTTP APIapi:uhc:public_key
: Public key for verifying the authenticity of the provided JWTapi:uhc:token
: "Offline access" token for UHC APIclusters
: provide a list of UHC queries as strings here. Each the cluster IDs returned by each query will be reported onglobal_vars
: provide a list of strings/ints/floats here to make them available as global variables to each rule. For example, providing- foo: "bar"
here will replace any instance of${foo}
in each rule query withbar
. At a minimum, you should provide aduration
variable (in days) here.rules
: provide a list of SLI rules to evaluate (see below)rules:name
: a human-readable name for the rulerules:goal
: the target-value for the query result. Usually a percentage represented as a float between 0 and 1.0rules:query
: a valid PromQL query that returns the current value of the SLI (which will be compared to the goal)
Command line tool
$ telemeter-reporter -h
usage: telemeter-reporter [-h] [-c PATH] [-f FMT] [-u QUERY] [-t TITLE] [-b]
[-l LEVEL] [-o VARS]
output
Tool for generating reports on SLA/SLO compliance using Telemeter-LTS data
positional arguments:
output Path to where to save the generated report (- =
stdout)
optional arguments:
-h, --help show this help message and exit
-c PATH, --config PATH
Path to YAML file containing configuration data
(default: ~/.telemeter_reporter.yml)
-f FMT, --format FMT Format for the report. Options: ['simple', 'plain',
'html', 'csv', 'grid', 'fancy_grid', 'github', 'jira',
'latex'] (default: simple)
-u QUERY, --uhc-query QUERY
Report on all clusters returned by this query to the
UHC API (default: None)
-t TITLE, --title TITLE
Optional title for HTML reports (default: None)
-b, --no-browser Don't open the resulting report in a web browser (if
HTML report is selected) (default: False)
-l LEVEL, --log LEVEL
Set the verbosity/logging level. Options: ['critical',
'error', 'warning', 'info', 'debug'] (default:
warning)
-o VARS, --override VARS
Override global variables set in the configuration
file. Provide a valid Python dict string, e.g.
"{'duration': 28}" (default: None)
Note: the -u
parameter overrides any clusters
list provided in a config file.
Project details
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
Close
Hashes for telemeter_reporter-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1914e9eca05b22733075b4cb2afed3a796b8c483d499798f508b4a90f048f9b2 |
|
MD5 | 01db91f1676349f095dcd67d9f6248fb |
|
BLAKE2b-256 | a1290e4b9a9e7277adebdb3840c7c75ec8d1c99d6b5f5de7eabc0b618fb9c548 |