-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |