From f6619a76ab19b8e2b11c62b3a942211fb24173a9 Mon Sep 17 00:00:00 2001 From: rv404674 Date: Sat, 10 Oct 2020 15:49:44 +0530 Subject: [PATCH] Fixed Prometheus scraping bug --- prometheus.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/prometheus.yml b/prometheus.yml index d7d32eb..196f60e 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -1,3 +1,10 @@ +global: + scrape_interval: 15s # By default, scrape targets every 15 seconds. + evaluation_interval: 15s # By default, scrape targets every 15 seconds. + +# NOTE: use this to validate config file +# ./promtool check config prometheus.yml + # Alertmanager configuration alerting: alertmanagers: @@ -26,5 +33,11 @@ scrape_configs: - job_name: 'golang_app' # will give application metrics metrics_path: /metrics + # scrape_interval defines after how much time, targets will be scraped for metrics. + # scrape_timeout - Prometheus will try for 30s to scrape the metrics, if it can't scrap in this time, + # it will timeout. + + # scrape_interval: 30s + # scrape_timeout: 20s static_configs: - targets: ['localhost:8080'] \ No newline at end of file