|
URL_CLUSTER_NAME_MAPPING = { |
|
"https://thanos-querier-openshift-monitoring.apps.shift.nerc.mghpcc.org": "ocp-prod", |
|
"https://thanos-querier-openshift-monitoring.apps.ocp-test.nerc.mghpcc.org": "ocp-test", |
|
"https://thanos-querier-openshift-monitoring.apps.edu.nerc.mghpcc.org": "academic", |
|
"https://thanos-querier-openshift-monitoring.apps.barcelona.nerc.mghpcc.org": "barcelona", |
|
} |
Right now we use the URL we query the metrics from to map to a cluster name. A better solution would be to use cluster ID which is part of the metrics we contain. This means that the URL could be either thanos or prometheus and we would still get the same cluster. We could even query from observeablity and have no problems mapping to a known name.
This should also be read from a config file instead of being hardcoded.
openshift-usage-scripts/openshift_metrics/openshift_prometheus_metrics.py
Lines 41 to 46 in 3565b36
Right now we use the URL we query the metrics from to map to a cluster name.
A better solution would be to use cluster ID which is part of the metrics we contain.This means that the URL could be either thanos or prometheus and we would still get the same cluster. We could even query from observeablity and have no problems mapping to a known name.This should also be read from a config file instead of being hardcoded.