diff --git a/docker compositions/monitoring/README.md b/docker compositions/monitoring/README.md index 991a6a5..2b72d2e 100644 --- a/docker compositions/monitoring/README.md +++ b/docker compositions/monitoring/README.md @@ -44,7 +44,7 @@ Will be requested to change them upon first login. [grafana]: ../../knowledge%20base/grafana.md -[prometheus]: ../../knowledge%20base/prometheus.md +[prometheus]: ../../knowledge%20base/prometheus/README.md [prometheus' configuration file]: prometheus/prometheus.yml diff --git a/knowledge base/cortex.md b/knowledge base/cortex.md index 90f4c6d..846f008 100644 --- a/knowledge base/cortex.md +++ b/knowledge base/cortex.md @@ -66,7 +66,7 @@ Alternatives: [mimir]: mimir.md -[prometheus]: prometheus.md +[prometheus]: prometheus/README.md [thanos]: thanos.md diff --git a/knowledge base/grafana.md b/knowledge base/grafana.md index 1180321..3d6b7b6 100644 --- a/knowledge base/grafana.md +++ b/knowledge base/grafana.md @@ -236,7 +236,7 @@ All the references in the [further readings] section, plus the following: [loki]: loki.md -[prometheus]: prometheus.md +[prometheus]: prometheus/README.md [docker compositions/monitoring]: ../docker%20compositions/monitoring/README.md diff --git a/knowledge base/mimir.md b/knowledge base/mimir.md index 3414a02..53900b8 100644 --- a/knowledge base/mimir.md +++ b/knowledge base/mimir.md @@ -317,7 +317,7 @@ Alternatives: [cortex]: cortex.md [grafana]: grafana.md -[prometheus]: prometheus.md +[prometheus]: prometheus/README.md [thanos]: thanos.md diff --git a/knowledge base/prometheus.md b/knowledge base/prometheus/README.md similarity index 93% rename from knowledge base/prometheus.md rename to knowledge base/prometheus/README.md index 4d81a4c..e33adc0 100644 --- a/knowledge base/prometheus.md +++ b/knowledge base/prometheus/README.md @@ -1,11 +1,9 @@ # Prometheus -Monitoring and alerting system that collects metrics from configured targets at given intervals, evaluates rule -expressions, displays the results, and can trigger alerts when specified conditions are observed. +Metrics gathering and alerting tool. -Works normally by scraping metrics from monitored hosts.
-Metrics can also be pushed to Prometheus servers via plugins, in the event source hosts are behind a firewall or -prohibited from opening ports by security policies. +It collects metrics, evaluates rule expressions, displays the results, and can trigger alerts when specified conditions +are observed. 1. [TL;DR](#tldr) 1. [Components](#components) @@ -27,6 +25,23 @@ prohibited from opening ports by security policies. ## TL;DR +Metrics are values that measure something. + +Prometheus is designed to store metrics' changes over time. + +Prometheus collects metrics by: + +- Actively **pulling** (_scraping_) them from configured _targets_ at given intervals.
+ Targets shall expose an HTTP endpoint for Prometheus to scrape. +- Having them **pushed** to it by clients.
+ This is most useful in the event the sources are behind firewalls, or otherwise prohibited from opening ports by + security policies. + +One can leverage _exporters_ collect metrics from targets that do **not** natively provide a suitable HTTP endpoint for +Prometheus to scrape from.
+Exporters are small and purpose-built applications that collect their objects' metrics in different ways, then expose +them in an HTTP endpoint in their place. + ```sh # Start the process. prometheus @@ -200,7 +215,7 @@ When using time ranges, the returned vector will be a _range vector_. 100 * (1 - avg by(instance)(irate(node_cpu_seconds_total{job='node_exporter',mode='idle'}[5m]))) ``` -![advanced query](prometheus%20advanced%20query.png) +![advanced query](advanced%20query%20result.png) Labels are used to filter the job and the mode. @@ -414,9 +429,6 @@ Typically achieved by: - [Documentation] - [Helm chart] - [`docker/monitoring`][docker/monitoring] -- [Node exporter] -- [SNMP exporter] -- [`ordaa/boinc_exporter`][ordaa/boinc_exporter] - [Grafana] - [High Availability for Prometheus and Alertmanager: An Overview] - [Making Prometheus Highly Available (HA) & Scalable with Thanos] @@ -428,13 +440,15 @@ Typically achieved by: - [Thanos] - Grafana's [Mimir] +Exporters: + +- [Node exporter] +- [SNMP exporter] +- [`ordaa/boinc_exporter`][ordaa/boinc_exporter] + ### Sources - [Getting started with Prometheus] -- [Node exporter guide] -- [SNMP monitoring and easing it with Prometheus] -- [`prometheus/node_exporter`][prometheus/node_exporter] -- [`prometheus/snmp_exporter`][prometheus/snmp_exporter] - [How I monitor my OpenWrt router with Grafana Cloud and Prometheus] - [Scrape selective metrics in Prometheus] - [Dropping metrics at scrape time with Prometheus] @@ -442,7 +456,6 @@ Typically achieved by: - [Install Prometheus and Grafana with helm 3 on a local machine VM] - [Set up prometheus and ingress on kubernetes] - [How to integrate Prometheus and Grafana on Kubernetes using Helm] -- [node-exporter's helm chart's values] - [How to set up and experiment with Prometheus remote-write] - [Install Prometheus and Grafana by Helm] - [Prometheus and Grafana setup in Minikube] @@ -455,15 +468,15 @@ Typically achieved by: --> -[cortex]: cortex.md -[grafana]: grafana.md -[mimir]: mimir.md +[cortex]: ../cortex.md +[grafana]: ../grafana.md +[mimir]: ../mimir.md [node exporter]: node%20exporter.md [snmp exporter]: snmp%20exporter.md -[thanos]: thanos.md +[thanos]: ../thanos.md -[docker/monitoring]: ../docker%20compositions/monitoring/README.md +[docker/monitoring]: ../../docker%20compositions/monitoring/README.md [codebase]: https://github.com/prometheus/prometheus @@ -471,10 +484,6 @@ Typically achieved by: [functions]: https://prometheus.io/docs/prometheus/latest/querying/functions/ [helm chart]: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus [metric_relabel_configs]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs -[node exporter guide]: https://prometheus.io/docs/guides/node-exporter/ -[node-exporter's helm chart's values]: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-node-exporter -[prometheus/node_exporter]: https://github.com/prometheus/node_exporter -[prometheus/snmp_exporter]: https://github.com/prometheus/snmp_exporter [promql]: https://prometheus.io/docs/prometheus/latest/querying/basics/ [remote_write setting]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write [storage]: https://prometheus.io/docs/prometheus/latest/storage/ @@ -501,4 +510,3 @@ Typically achieved by: [scaling prometheus with cortex]: https://www.infracloud.io/blogs/cortex-for-ha-monitoring-with-prometheus/ [scrape selective metrics in prometheus]: https://docs.last9.io/docs/how-to-scrape-only-selective-metrics-in-prometheus [set up prometheus and ingress on kubernetes]: https://blog.gojekengineering.com/diy-how-to-set-up-prometheus-and-ingress-on-kubernetes-d395248e2ba -[snmp monitoring and easing it with prometheus]: https://medium.com/@openmohan/snmp-monitoring-and-easing-it-with-prometheus-b157c0a42c0c diff --git a/knowledge base/prometheus advanced query.png b/knowledge base/prometheus/advanced query result.png similarity index 100% rename from knowledge base/prometheus advanced query.png rename to knowledge base/prometheus/advanced query result.png diff --git a/knowledge base/node exporter.md b/knowledge base/prometheus/node exporter.md similarity index 61% rename from knowledge base/node exporter.md rename to knowledge base/prometheus/node exporter.md index c7727d2..e24f8d6 100644 --- a/knowledge base/node exporter.md +++ b/knowledge base/prometheus/node exporter.md @@ -1,10 +1,10 @@ # Prometheus' node exporter -## Table of contents +TODO 1. [TL;DR](#tldr) 1. [Further readings](#further-readings) -1. [Sources](#sources) + 1. [Sources](#sources) ## TL;DR @@ -17,25 +17,23 @@ sudo apt install 'prometheus-node-exporter' ## Further readings -- [Github] +- [Codebase] - [Prometheus] -## Sources - -All the references in the [further readings] section, plus the following: +### Sources - [Node exporter guide] +- [Helm chart values] - -[github]: https://github.com/prometheus/node_exporter -[node exporter guide]: https://prometheus.io/docs/guides/node-exporter/ - - -[further readings]: #further-readings - -[prometheus]: prometheus.md +[prometheus]: README.md + + +[codebase]: https://github.com/prometheus/node_exporter +[helm chart values]: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-node-exporter +[node exporter guide]: https://prometheus.io/docs/guides/node-exporter/ diff --git a/knowledge base/snmp exporter.md b/knowledge base/prometheus/snmp exporter.md similarity index 53% rename from knowledge base/snmp exporter.md rename to knowledge base/prometheus/snmp exporter.md index ec189e9..60a3bf8 100644 --- a/knowledge base/snmp exporter.md +++ b/knowledge base/prometheus/snmp exporter.md @@ -1,33 +1,29 @@ # Prometheus' SNMP exporter -## Table of contents +TODO 1. [Further readings](#further-readings) -1. [Sources](#sources) + 1. [Sources](#sources) ## Further readings -- [Github] +- [Codebase] - [Prometheus] -## Sources - -All the references in the [further readings] section, plus the following: +### Sources - [SNMP monitoring and easing it with Prometheus] - -[github]: https://github.com/prometheus/snmp_exporter - - -[further readings]: #further-readings - -[prometheus]: prometheus.md +[prometheus]: README.md + + +[codebase]: https://github.com/prometheus/snmp_exporter [snmp monitoring and easing it with prometheus]: https://medium.com/@openmohan/snmp-monitoring-and-easing-it-with-prometheus-b157c0a42c0c diff --git a/knowledge base/thanos.md b/knowledge base/thanos.md index bce1570..6c0cfd4 100644 --- a/knowledge base/thanos.md +++ b/knowledge base/thanos.md @@ -67,7 +67,7 @@ Alternatives: [cortex]: cortex.md [mimir]: mimir.md -[prometheus]: prometheus.md +[prometheus]: prometheus/README.md