From 2add2e5a03cbe17bcb9a51238571430f73a9999a Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 15 Jan 2020 18:42:15 +0800 Subject: [PATCH] add prometheus --- README.md | 1 + prometheus/README.md | 6 ++++++ prometheus/data/prometheus.yml | 29 +++++++++++++++++++++++++++++ prometheus/docker-compose.yml | 9 +++++++++ 4 files changed, 45 insertions(+) create mode 100644 prometheus/README.md create mode 100644 prometheus/data/prometheus.yml create mode 100644 prometheus/docker-compose.yml diff --git a/README.md b/README.md index 6580c21..4734c96 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,7 @@ A collection of delicious docker recipes. - [x] devopsfaith/krakend - [x] netdata/netdata - [x] nextcloud +- [x] prom/prometheus - [x] sonatype/nexus3 - [ ] jwilder/nginx-proxy - [x] jazzdd/phpvirtualbox diff --git a/prometheus/README.md b/prometheus/README.md new file mode 100644 index 0000000..eb73678 --- /dev/null +++ b/prometheus/README.md @@ -0,0 +1,6 @@ +prometheus +========== + +[Prometheus][1] is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. + +[1]: https://prometheus.io/docs/introduction/overview/ diff --git a/prometheus/data/prometheus.yml b/prometheus/data/prometheus.yml new file mode 100644 index 0000000..af33d87 --- /dev/null +++ b/prometheus/data/prometheus.yml @@ -0,0 +1,29 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +# Alertmanager configuration +alerting: + alertmanagers: + - static_configs: + - targets: + # - alertmanager:9093 + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=` to any timeseries scraped from this config. + - job_name: 'prometheus' + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ['localhost:9090'] diff --git a/prometheus/docker-compose.yml b/prometheus/docker-compose.yml new file mode 100644 index 0000000..2b65090 --- /dev/null +++ b/prometheus/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.7" +services: + prometheus: + image: prom/prometheus + ports: + - "9090:9090" + volumes: + - ./data:/etc/prometheus + restart: unless-stopped