From fd8e5b9e1f5150263c5a9c883c64deae03fae4d7 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Wed, 23 Dec 2020 21:13:56 +0500 Subject: [PATCH] Documentation. --- CHANGELOG.md | 2 +- docs/CONFIGURE.md | 21 +++++++++++++++++++++ docs/INDEX.md | 18 ++++++++++++++++++ docs/INSTALL.md | 42 +++++++++++++++++++++++++++++++++++++++++ metricator.example.yaml | 2 +- 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 docs/CONFIGURE.md create mode 100644 docs/INSTALL.md diff --git a/CHANGELOG.md b/CHANGELOG.md index cb9a6ac..0db11f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.1.0] - 2020-12-2x +## [0.1.0] - 2020-12-23 Initial release. diff --git a/docs/CONFIGURE.md b/docs/CONFIGURE.md new file mode 100644 index 0000000..0024f12 --- /dev/null +++ b/docs/CONFIGURE.md @@ -0,0 +1,21 @@ +# Configuration + +This page describes every configuration value. + +## The Table + +| Variable | Type | Description | +| -------- | ---- | ----------- | +| applications > APPNAME > endpoint | string | Prometheus metrics endpoint URL. | +| applications > APPNAME > headers > MAP | map | Headers which should be added to request. See example below. | +| applications > APPNAME > time_between_requests | string | time.Duration-compatible string which represents timeout between requests. | + +## Headers map example + +``` +applications: + example: + headers: + HeaderOne: valueOne + HeaderTwo: valueTwo +``` diff --git a/docs/INDEX.md b/docs/INDEX.md index 4186dec..4f7c62b 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -10,4 +10,22 @@ Why proxy? Let's go by example. Imagine that software you wish to monitor with classic NMS exposes 250 metric items and you wrote a simple script which returns needed data. Classic NMSes is able to process only one value per checker (usually), which means that processing every metric will do 250 HTTP requests to monitored software which is obviously not good. +Of course you can write own script that will request once and another script that will parse saved data, but how would you deal with parametrized metrics (like `dnsdist_frontend_responses{frontend="127.0.0.1:53",proto="UDP",thread="0"}`)? This will definetely took a lot of brain cells and time. + Metricator instead acts like Prometheus itself from monitored software PoV: it performs one HTTP request each timeout (configured in config), parses data and making it available to other requesters. As parsed metric data stored in memory it will be blazing fast and won't overload your system. + +Also Metricator "reformats" metric names and parameters to be more easily parsed if needed, so: + +``` +dnsdist_frontend_responses{frontend="127.0.0.1:53",proto="UDP",thread="0"} +``` + +became: + +``` +dnsdist_frontend_responses/frontend:127.0.0.1:53/proto:UDP/thread:0 +``` + +## Docs + +* [Installation](INSTALL.md) diff --git a/docs/INSTALL.md b/docs/INSTALL.md new file mode 100644 index 0000000..d435636 --- /dev/null +++ b/docs/INSTALL.md @@ -0,0 +1,42 @@ +# Installing Metricator + +There are three ways to install metricator: + +1. Using Docker image. +2. Using pre-built binaries. +3. From source + +This page describes all of them. + +## Docker + +To run Metricator in Docker simply run: + +``` +docker run -v $(pwd)/metricator.yaml:/config.yaml -p 8080:34421 registry.gitlab.pztrn.name/pztrn/metricator:latest +``` + +Don't forget to create configuration file as described [here](CONFIGURE.md)! + +### docker-compose + +``` +version: "2.4" + +services: + metricator: + image: registry.gitlab.pztrn.name/pztrn/metricator:latest + restart: always + ports: + - 8080:34421 + volumes: + - /full/path/to/metricator.yaml:/config.yaml +``` + +## Pre-built binaries + +To be written. Stay tuned. + +## From source + +To be written. Stay tuned. diff --git a/metricator.example.yaml b/metricator.example.yaml index 057040c..9e39247 100644 --- a/metricator.example.yaml +++ b/metricator.example.yaml @@ -7,7 +7,7 @@ applications: # Headers to append to request. headers: X-API-KEY: th4apik3yh4rdt0gu3ss - # Timeout between requests. Not neccessarily be exact and requests might + # Timeout between requests. Not necessarily be exact and requests might # be sent in 60 or more seconds (in this example). time_between_requests: 60s