Skip to content

Commit

Permalink
docs: prometheus howto
Browse files Browse the repository at this point in the history
  • Loading branch information
onong committed Jun 13, 2024
1 parent 8b7af52 commit 5480201
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/prometheus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Prometheus howto

Create a `prometheus.yml` file:

```
scrape_configs:
- job_name: myapp
scrape_interval: 10s
static_configs:
- targets:
- 172.18.0.2:8888
- 172.18.0.3:8888
- 172.18.0.4:8888
- 172.18.0.6:8888
```

Replace the IP addrs under `targets` to the actual IP addrs of the worker nodes
in the cluster.


Run the prometheus container:


```bash
docker run --network host -p 9090:9090 -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus &
```


Point browser to the IP addr of the node where prometheus is running:

```
http://<prometheus node IP addr>:9090
```


Another simple test to see if prometheus is working:


```bash
$ curl http://<worker node IP addr>:8888/metrics
```

0 comments on commit 5480201

Please sign in to comment.