Add prometheus and grafana make commands for local environment#12240
Conversation
0b171a3 to
ae805e2
Compare
1f3b6ca to
568f93c
Compare
| {% if control_plane_node_count|int > 1 %} | ||
| haproxy: | ||
| image: haproxy | ||
| image: haproxy:2.3 |
There was a problem hiding this comment.
looks like bleed over from another open PR you have.
|
|
||
| 1. Change the `username` and `password` in `tools/prometheus/prometheus.yml`. You can also change the scrape interval. | ||
| 2. (optional) if you are in cluster environment, you can change the target to `haproxy:8043` so that the incoming prometheus requests go through the load balancer. Leaving it set to `awx1` also works. | ||
| 3. run `make prometheus` |
There was a problem hiding this comment.
like, in a new terminal tab or something?
| "refId": "B" | ||
| } | ||
| ], | ||
| "title": "jobs running pending", |
There was a problem hiding this comment.
the title confuses me somewhat
| Prometheus is a metrics collecting tool, and we support prometheus formatted data at the `api/v2/metrics` endpoint. | ||
|
|
||
| 1. Change the `username` and `password` in `tools/prometheus/prometheus.yml`. You can also change the scrape interval. | ||
| 2. (optional) if you are in cluster environment, you can change the target to `haproxy:8043` so that the incoming prometheus requests go through the load balancer. Leaving it set to `awx1` also works. |
There was a problem hiding this comment.
Are these new tools for dev testing only or are they actually intended to be run against something like a cluster?
There was a problem hiding this comment.
If we are leaving this in here you are in a clustered environment.
There was a problem hiding this comment.
intended for dev / testing usage
| 1. Change the `username` and `password` in `tools/prometheus/prometheus.yml`. You can also change the scrape interval. | ||
| 2. (optional) if you are in cluster environment, you can change the target to `haproxy:8043` so that the incoming prometheus requests go through the load balancer. Leaving it set to `awx1` also works. | ||
| 3. run `make prometheus` | ||
| 4. navigate to `http://localhost:9090/targets` and check that the metrics endpoint State is Up. |
There was a problem hiding this comment.
Do you mean the metrics API endpoint or an endpoint under prometheus (this is right after the prometheus URL).
There was a problem hiding this comment.
Also, would this be "localhost" or would that depend on your installation? In other places in this document we talk about "container_reference" and how one might get that.
| prometheus: | ||
| docker run -u0 --net=tools_default --link=`docker ps | egrep -o "tools_awx(_run)?_([^ ]+)?"`:awxweb --volume `pwd`/tools/prometheus:/prometheus --name prometheus -d -p 0.0.0.0:9090:9090 prom/prometheus --web.enable-lifecycle --config.file=/prometheus/prometheus.yml | ||
| docker volume create prometheus | ||
| docker run -d --rm --net=_sources_default --link=awx_1:awx1 --volume prometheus-storage:/prometheus --volume `pwd`/tools/prometheus:/etc/prometheus --name prometheus -p 9090:9090 prom/prometheus | ||
|
|
||
| grafana: | ||
| docker volume create grafana | ||
| docker run -d --rm --net=_sources_default --volume grafana-storage:/var/lib/grafana --volume `pwd`/tools/grafana:/etc/grafana/provisioning --name grafana -p 3001:3000 grafana/grafana-enterprise |
There was a problem hiding this comment.
Instead of individual targets should we move these into the model like we did for LDAP/SPLUNK/etc where you would do something like: GRAFANA=True make docker-compose?
There was a problem hiding this comment.
I would ultimately prefer this, but I think it makes sense to merge it with the current scheme and work on this later.
The biggest pain point for me of the current approach is that it doesn't show startup logs, and integrating it into docker-compose would fix that.
|
|
||
| - job_name: 'awx' | ||
| static_configs: | ||
| - targets: ['awx1:8043'] # or haproxy:8043 in cluster env |
There was a problem hiding this comment.
Should this be awx1 or tools_awx_1?
There was a problem hiding this comment.
prometheus expects a real dns name here, so underscores aren't allowed.
that is why I need to alias awx_1 to awx1 when starting the prometheus container
|
Link candidate fix AlanCoding@12c4807 |
8579cf8 to
6f68f3c
Compare
| prometheus: | ||
| docker run -u0 --net=tools_default --link=`docker ps | egrep -o "tools_awx(_run)?_([^ ]+)?"`:awxweb --volume `pwd`/tools/prometheus:/prometheus --name prometheus -d -p 0.0.0.0:9090:9090 prom/prometheus --web.enable-lifecycle --config.file=/prometheus/prometheus.yml | ||
| docker volume create prometheus | ||
| docker run -d --rm --net=_sources_default --link=awx_1:awx1 --volume prometheus-storage:/prometheus --volume `pwd`/tools/prometheus:/etc/prometheus --name prometheus -p 9090:9090 prom/prometheus |
There was a problem hiding this comment.
reminder for later - we need a target for something like
docker volume rm prometheus prometheus-storage grafana grafana-storage
SUMMARY
make prometheusandmake grafanawill start local docker containers that integrate with a running awx instance.ISSUE TYPE
COMPONENT NAME
AWX VERSION