This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
sw:prometheus:intro [2022/01/11 07:58] – created Frank Fegert | sw:prometheus:intro [2022/01/11 11:20] (current) – Frank Fegert | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Introduction ====== | ====== Introduction ====== | ||
- | FIXME | + | Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. Since its inception in 2012, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community. It is now a standalone open source project and maintained independently of any company. To emphasize this, and to clarify the project' |
+ | |||
+ | Prometheus collects and stores its metrics as time series data, i.e. metrics information is stored with the timestamp at which it was recorded, alongside optional key-value pairs called labels. | ||
+ | |||
+ | Prometheus' | ||
+ | |||
+ | * a multi-dimensional data model with time series data identified by metric name and key/value pairs < | ||
+ | * PromQL, a flexible query language to leverage this dimensionality < | ||
+ | * no reliance on distributed storage; single server nodes are autonomous < | ||
+ | * time series collection happens via a pull model over HTTP < | ||
+ | * pushing time series is supported via an intermediary gateway < | ||
+ | * targets are discovered via service discovery or static configuration < | ||
+ | * multiple modes of graphing and dashboarding support < | ||
====== Links ====== | ====== Links ====== | ||
- | FIXME | ||
===== General ===== | ===== General ===== | ||
- | FIXME | + | [[https:// |
- | + | ||
- | /* [[]]\\ | + | |
====== Docs ====== | ====== Docs ====== | ||
- | FIXME | + | [[https:// |
====== Files and Directories ====== | ====== Files and Directories ====== | ||
- | |||
- | FIXME | ||
===== General Files and Directories ===== | ===== General Files and Directories ===== | ||
- | FIXME | + | ^ File or Directory |
+ | | ''/ | ||
+ | | ''/ | ||
+ | | ''/ | ||
+ | | ''/ | ||
+ | | ''/ | ||
===== Configuration Files ===== | ===== Configuration Files ===== | ||
- | FIXME | + | ^ File or Directory |
+ | | ''/ | ||
+ | | ''/ | ||
====== Getting Help ====== | ====== Getting Help ====== | ||
- | FIXME | + | // |
- | Manual pages: | + | < |
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | '' | ||
<cli> | <cli> | ||
- | user@host: | + | user@host: |
</ | </ | ||
====== Install ====== | ====== Install ====== | ||
- | FIXME | + | To install // |
- | To install //// on Debian: | + | < |
+ | root@host: | ||
+ | root@host: | ||
+ | </cli> | ||
+ | |||
+ | Create the //Prometheus// '' | ||
<cli> | <cli> | ||
- | root@host: | + | root@host: |
- | </ | + | </ |
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config / | ||
+ | template(name=" | ||
+ | if ($programname startswith ' | ||
+ | | ||
+ | type=" | ||
+ | dynaFile=" | ||
+ | fileCreateMode=" | ||
+ | fileOwner=" | ||
+ | fileGroup=" | ||
+ | dirCreateMode=" | ||
+ | dirOwner=" | ||
+ | dirGroup=" | ||
+ | ioBufferSize=" | ||
+ | ) | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Restart the '' | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | </ | ||
+ | |||
+ | Create the // | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | root@host: | ||
+ | </ | ||
+ | |||
+ | If a local IPTables firewall is active on the system running // | ||
+ | |||
+ | <file config iptables.conf> | ||
+ | # Allow access to Prometheus from local networks | ||
+ | -A INPUT -p tcp -s < | ||
+ | </ | ||
+ | |||
+ | and reload the IPTables rules: | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | </ | ||
====== Configuration ====== | ====== Configuration ====== | ||
- | FIXME | + | ===== Initial ===== |
+ | |||
+ | Configure the // | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | </ | ||
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config / | ||
+ | [...] | ||
+ | ARGS=" | ||
+ | [...] | ||
+ | </ | ||
+ | |||
+ | ===== Adding Prometheus to Grafana ===== | ||
+ | |||
+ | See [[sw: | ||
+ | |||
+ | ===== Scraping metrics with Prometheus ===== | ||
+ | |||
+ | Configure // | ||
+ | |||
+ | ==== Loki ==== | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | </ | ||
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config / | ||
+ | [...] | ||
+ | scrape_configs: | ||
+ | [...] | ||
+ | - job_name: loki | ||
+ | static_configs: | ||
+ | - targets: [' | ||
+ | [...] | ||
+ | [...] | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Promtail ==== | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | </ | ||
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config / | ||
+ | [...] | ||
+ | scrape_configs: | ||
+ | [...] | ||
+ | - job_name: promtail | ||
+ | static_configs: | ||
+ | - targets: [' | ||
+ | [...] | ||
+ | [...] | ||
+ | </ | ||
====== Usage ====== | ====== Usage ====== | ||
- | FIXME | + | ===== Start ===== |
- | ===== Status Check ===== | + | To start // |
- | FIXME | + | < |
+ | root@host: | ||
+ | root@host: | ||
+ | </ | ||
+ | |||
+ | ===== Stop ===== | ||
+ | |||
+ | To stop // | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | </ | ||
+ | |||
+ | ===== Status Check ===== | ||
- | To check the status of ////: | + | To check the status of //Prometheus//: |
<cli> | <cli> | ||
- | root@host: | + | root@host: |
</ | </ | ||