From 852403cc32e880779a6463fb3fcbba9296b42b39 Mon Sep 17 00:00:00 2001 From: Nguyen Tran Hau Date: Fri, 12 Jun 2020 17:35:23 +0700 Subject: [PATCH] Update prometheus.md --- src/Development/prometheus.md | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/Development/prometheus.md b/src/Development/prometheus.md index ea35c8e..025a74d 100644 --- a/src/Development/prometheus.md +++ b/src/Development/prometheus.md @@ -1,46 +1,34 @@ # Prometheus -Read [Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/). - Docker: ```sh -docker run -d \ - -p 9090:9090 \ - -v /path/to/config:/etc/prometheus \ - --name prometheus - prom/prometheus +docker run --rm -p 9090:9090 --name prometheus prom/prometheus + +# Custom configuration +docker run --rm -p 9090:9090 -v "$(pwd)"/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml --name prometheus prom/prometheus ``` -UI: +UI ```txt localhost:9090 -``` - -Metrics: - -```txt localhost:9090/metrics ``` ## Pushing metrics -Read [Pushing metrics](https://prometheus.io/docs/instrumenting/pushing/) - Docker: ```sh -docker run -d \ - -p 9091:9091 \ - --name pushgateway - prom/pushgateway +docker run --rm -p 9091:9091 --name pushgateway prom/pushgateway ``` UI: ```txt localhost:9091 +localhost:9091/metrics ``` To configure the Pushgateway as a target to scrape by Prometheus,