From d33a7d4379704c3437bcb288dd39607575615ef5 Mon Sep 17 00:00:00 2001 From: kev Date: Mon, 29 Nov 2021 11:35:32 +0800 Subject: [PATCH] update prometheus --- prometheus/data/etc/prometheus.yml | 19 +++++++++++++++++++ prometheus/data/prometheus.yml | Bin 20391 -> 0 bytes prometheus/data/var/.gitkeep | 0 prometheus/docker-compose.yml | 12 +++++++++--- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 prometheus/data/etc/prometheus.yml delete mode 100644 prometheus/data/prometheus.yml create mode 100644 prometheus/data/var/.gitkeep diff --git a/prometheus/data/etc/prometheus.yml b/prometheus/data/etc/prometheus.yml new file mode 100644 index 0000000..93c24da --- /dev/null +++ b/prometheus/data/etc/prometheus.yml @@ -0,0 +1,19 @@ +global: + scrape_interval: 15s # By default, scrape targets every 15 seconds. + + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: + monitor: 'codelab-monitor' + +# 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' + + # Override the global default and scrape targets from this job every 5 seconds. + scrape_interval: 5s + + static_configs: + - targets: ['localhost:9090'] diff --git a/prometheus/data/prometheus.yml b/prometheus/data/prometheus.yml deleted file mode 100644 index 1997f9951ffbf469593c6e58918276af571828cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20391 zcmeI4O>fgM7{@tB+9&Ac(Rv6-ti(>s){YG!7@81F2qrGo)Om^98aZ(lI}^R|*?F9o zQ4rdRLoGc~mHOR(|7_)7#j1x;Y+!7cbuaV`{KX~~ zhVWH7aBJBWfxZYh1M*&0TPy}vVvD&Q!8^GWwRWIvp9zI3YbQt8iNuy`;gl(NI%+$) zXtN|#wU!TccN)G%1^Hu*5Bo7VRY+4e60DbQ8ui`4`zD^U#6BBE(GcEfS-C=#VkN7N zOItzAhoY~xZ^5|oQAe6CC( zaTvA5xRrW2in;~218)d^j=!5bC`Ex4Er>jqIS34Z7I#v^E#{uR!rQ_ZIluM&iE;~m z$}O_PmD9GH!xFnha@b1SgH$eqRWcA zk~YIRd03EbnYD8pB;S;Hd}+Wu)&?heZLIU_A&GCICv*`3B0vO)01+SpM1Tko0U|&I zhyW2F0z`la5CI}U1c(3;AOb{y2oM1xKm>>Y5g-CYfCvx)B0vO)01+SpM1Tko0U|&I zhyW2F0z`la5P|km?YyS%GjrAdMRHv=qm5Dn(jaq-jtC1-Chl#Sx|UE??ajX3vv&+%md8jl0ecoKld zX#g5o5`swoc;ELYB;z5748dzy2xh}Va2pna-LMe+hJ|1_ECk2lAvg{X!Ety9j>AK6 z93Fz>@DLn_hu}Co1jpeaI1UfNancYRCk?@I(hwXc4Z(5J5F95B!Ew?M948IIaq#u| z{=a6yH~*;0ykKzLjV8( diff --git a/prometheus/data/var/.gitkeep b/prometheus/data/var/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/prometheus/docker-compose.yml b/prometheus/docker-compose.yml index 2b65090..b48024e 100644 --- a/prometheus/docker-compose.yml +++ b/prometheus/docker-compose.yml @@ -1,9 +1,15 @@ -version: "3.7" +version: "3.8" services: prometheus: - image: prom/prometheus + image: prom/prometheus:v2.31.1 + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/var/lib/prometheus' + - '--web.console.libraries=/usr/share/prometheus/console_libraries' + - '--web.console.templates=/usr/share/prometheus/consoles' ports: - "9090:9090" volumes: - - ./data:/etc/prometheus + - ./data/etc:/etc/prometheus + - ./data/var:/var/lib/prometheus restart: unless-stopped