This project generates a number of metrics used for business analysis.
- acm_managed_cluster_info
make run
curl http://localhost:8080/metrics
curl http://localhost:8080/metrics
# HELP acm_managed_cluster_info Managed cluster information
# TYPE acm_managed_cluster_info gauge
acm_managed_cluster_info{hub_cluster_id="faddba46-201e-4d5d-bf52-9918517a9e6a",managed_cluster_id="faddba46-201e-4d5d-bf52-9918517a9e6a",vendor="OpenShift",cloud="Amazon",version="v1.16.2",created_via="Other",vcpu="4"} 1
Each steps can be run separatly:
oc login
your hub RHACM cluster.- Set in the kustomization.yaml the namespace where you want the collector to be deployed.
- Same for servicemonitor.yaml and clusterrole_binding.yaml
- Set the following
IMG
environment variable, this is the name of the image and where it will be pushed.
export QUAY_USER=<your_user>
export IMG_TAG=<tag_you_want_to_use>
export IMG=quay.io/${QUAY_USER}/clusterlifecycle-state-metrics:${IMG_TAG}
make docker-build docker-push deploy
make docker-build
make docker-push
make deploy
It also creates an ingress which allows to retrieve the infomration from outside of the cluster.
The metrics then will appear on prometheus.
- Retrieve the number of imported clusters per hub:
sum by (hub_cluster_id) (
acm_managed_cluster_info
)
and per vendor:
sum by (hub_cluster_id, vendor) (
acm_managed_cluster_info
)
and per cloud:
sum by (hub_cluster_id, cloud) (
acm_managed_cluster_info
)
and per version:
sum by (hub_cluster_id, version) (
acm_managed_cluster_info
)
Rebuild: Tue Nov 29 19:14:11 EST 2022