til/Development/prometheus.md

56 lines
783 B
Markdown
Raw Normal View History

2020-04-18 20:21:04 +00:00
# Prometheus
Read [Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/).
2020-05-09 13:59:17 +00:00
Docker:
2020-04-18 20:21:04 +00:00
```sh
2020-05-09 13:59:17 +00:00
docker run -d \
-p 9090:9090 \
-v /path/to/config:/etc/prometheus \
2020-05-09 16:16:00 +00:00
--name prometheus
2020-05-09 13:59:17 +00:00
prom/prometheus
2020-04-18 20:21:04 +00:00
```
UI:
```txt
2020-05-09 13:59:17 +00:00
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 \
2020-05-09 16:16:00 +00:00
--name pushgateway
2020-05-09 13:59:17 +00:00
prom/pushgateway
2020-04-18 20:21:04 +00:00
```
2020-05-09 14:22:50 +00:00
UI:
```txt
localhost:9091
```
To configure the Pushgateway as a target to scrape by Prometheus,
add to Prometheus configuration file:
```yaml
scrape_configs:
- job_name: "pushgateway"
honor_labels: true
static_configs:
- targets: ["localhost:9091"]
```