From d7321cd89cc5fbdd90cbc4684904ad92c2050185 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 21 Nov 2017 09:55:42 +0100 Subject: [PATCH] prom: initial docker block for prometheus 2 --- docker/blocks/prometheus2/Dockerfile | 3 ++ docker/blocks/prometheus2/alert.rules | 10 +++++++ docker/blocks/prometheus2/prometheus.yml | 35 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 docker/blocks/prometheus2/Dockerfile create mode 100644 docker/blocks/prometheus2/alert.rules create mode 100644 docker/blocks/prometheus2/prometheus.yml diff --git a/docker/blocks/prometheus2/Dockerfile b/docker/blocks/prometheus2/Dockerfile new file mode 100644 index 00000000000..d4a9eb2d75d --- /dev/null +++ b/docker/blocks/prometheus2/Dockerfile @@ -0,0 +1,3 @@ +FROM prom/prometheus:v2.0.0 +ADD prometheus.yml /etc/prometheus/ +ADD alert.rules /etc/prometheus/ diff --git a/docker/blocks/prometheus2/alert.rules b/docker/blocks/prometheus2/alert.rules new file mode 100644 index 00000000000..563d1e89994 --- /dev/null +++ b/docker/blocks/prometheus2/alert.rules @@ -0,0 +1,10 @@ +# Alert Rules + +ALERT AppCrash + IF process_open_fds > 0 + FOR 15s + LABELS { severity="critical" } + ANNOTATIONS { + summary = "Number of open fds > 0", + description = "Just testing" + } diff --git a/docker/blocks/prometheus2/prometheus.yml b/docker/blocks/prometheus2/prometheus.yml new file mode 100644 index 00000000000..83dda78bb3c --- /dev/null +++ b/docker/blocks/prometheus2/prometheus.yml @@ -0,0 +1,35 @@ +# my global config +global: + scrape_interval: 10s # By default, scrape targets every 15 seconds. + evaluation_interval: 10s # By default, scrape targets every 15 seconds. + # scrape_timeout is set to the global default (10s). + +# Load and evaluate rules in this file every 'evaluation_interval' seconds. +#rule_files: +# - "alert.rules" +# - "first.rules" +# - "second.rules" + +# alerting: +# alertmanagers: +# - scheme: http +# static_configs: +# - targets: +# - "127.0.0.1:9093" + +scrape_configs: + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + + - job_name: 'node_exporter' + static_configs: + - targets: ['127.0.0.1:9100'] + + - job_name: 'fake-data-gen' + static_configs: + - targets: ['127.0.0.1:9091'] + + - job_name: 'grafana' + static_configs: + - targets: ['127.0.0.1:3000']