Add ceph metrics to postrun metrics gathering role

This updates the gather-prom-metrics role to include gathering
metrics from the active ceph-mgr endpoint

Change-Id: Icb5d27b6a070e9065f6276725bf06dec7d2cbc0d
Signed-off-by: Steve Wilkerson <sw5822@att.com>
This commit is contained in:
Steve Wilkerson 2019-11-13 10:11:26 -06:00 committed by Steve Wilkerson
parent 6ca136bae4
commit ef4cbb3b08
1 changed files with 20 additions and 0 deletions

View File

@ -38,6 +38,26 @@
executable: /bin/bash
ignore_errors: True
- name: "Get ceph metrics from ceph-mgr"
shell: |-
set -e
mgr_endpoints=$(kubectl get endpoints -n ceph -l component=manager -o json | jq -r '.items[].subsets[].addresses[].ip')
echo "ceph-mgr endpoints: $mgr_endpoints"
for endpoint in $mgr_endpoints; do
echo "checking ceph-mgr at $endpoint"
metrics_curl="curl $endpoint:9283/metrics"
op=$(eval "$metrics_curl")
if [[ -n $op ]]; then
curl $endpoint:9283/metrics >> "{{ logs_dir }}"/prometheus/ceph-ceph-mgr.txt
break
else
echo "$endpoint is a standby ceph-mgr. Trying next endpoint"
fi
done
args:
executable: /bin/bash
ignore_errors: True
- name: "Downloads logs to executor"
synchronize:
src: "{{ logs_dir }}/prometheus"