Update prometheus.md

main
Nguyen Tran Hau 2020-06-12 17:35:23 +07:00 committed by GitHub
parent ac02b0000b
commit 852403cc32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 19 deletions

View File

@ -1,46 +1,34 @@
# Prometheus # Prometheus
Read [Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/).
Docker: Docker:
```sh ```sh
docker run -d \ docker run --rm -p 9090:9090 --name prometheus prom/prometheus
-p 9090:9090 \
-v /path/to/config:/etc/prometheus \ # Custom configuration
--name prometheus docker run --rm -p 9090:9090 -v "$(pwd)"/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml --name prometheus prom/prometheus
prom/prometheus
``` ```
UI: UI
```txt ```txt
localhost:9090 localhost:9090
```
Metrics:
```txt
localhost:9090/metrics localhost:9090/metrics
``` ```
## Pushing metrics ## Pushing metrics
Read [Pushing metrics](https://prometheus.io/docs/instrumenting/pushing/)
Docker: Docker:
```sh ```sh
docker run -d \ docker run --rm -p 9091:9091 --name pushgateway prom/pushgateway
-p 9091:9091 \
--name pushgateway
prom/pushgateway
``` ```
UI: UI:
```txt ```txt
localhost:9091 localhost:9091
localhost:9091/metrics
``` ```
To configure the Pushgateway as a target to scrape by Prometheus, To configure the Pushgateway as a target to scrape by Prometheus,