From 8289890ccde5d6982ec9a5fde959f39deaf3404b Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 12 Dec 2024 09:39:36 +0100 Subject: [PATCH] update prometheus --- technology/applications/web/Prometheus.md | 52 ++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/technology/applications/web/Prometheus.md b/technology/applications/web/Prometheus.md index ce2e73f..43cef86 100644 --- a/technology/applications/web/Prometheus.md +++ b/technology/applications/web/Prometheus.md @@ -2,7 +2,57 @@ obj: application website: https://prometheus.io repo: https://github.com/prometheus/prometheus +rev: 2024-12-12 --- # Prometheus -#wip +Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. +It 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. +This data can then be visualized using [Grafana](./Grafana.md). + +## Docker Compose + +```yml +services: + prometheus: + image: prom/prometheus + ports: + - 9090:9090 + volumes: + - ./data:/prometheus + - ./conf:/etc/prometheus +``` + +## Configuration +Basic prometheus config: + +```yml +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: "prometheus" + static_configs: + - targets: ["localhost:9090"] + + # Node Exporter Config + - job_name: node_exporter + scrape_interval: 5s + static_configs: + - targets: ['host:9100'] + + # Job with custom CA + - job_name: custom_ca + static_configs: + - targets: ['endpoint'] + tls_config: + ca_file: '/ca_file.crt' + + # Job with Bearer Auth + - job_name: bearer_auth + scrape_interval: 120s + static_configs: + - targets: ['endpoint'] + bearer_token: 'BEARER_TOKEN' +```