Claim/composite resource metrics along with the labels to track down ownership of broken resources
What problem are you facing?
Currently with crossplane_managed_* resources , one can tell which managed resources are in a broken / unready state so the owners of them can act on fixing them. However, due to lack of information around claim / composite resources in the metrics that owns the broken managed resource, it's not clear how one can own the broken managed resource.
For example, if you run two claim apis of kind X and Y and they both create a managed resource of type Z, from the available metrics, one cannot tell if the broken / unready MR belongs to claim API X or Y.
Ref
How could Crossplane help solve your problem?
This might be fixed using the x-metrics operator which includes ability to read claim/composite level resource metrics . One of the metrics also has the ability to include all the labels on the detected resource metrics . However this also does not establish a clear relationship between claim -> composite -> managed. but it is a way forward to at the least to ensure the team owning API X can be informed when claim/composite X is unready.
Crossplane runtime could possibly implement these metrics out of the box for claim and composite resources and there could be another metric on the managed resources to fetch the labels to know which claim + composite it belongs to (Not sure if this is not implemented due to cardinality problems)
relates to https://github.com/crossplane/crossplane-runtime/issues/792
Take a look at this PR for crossplane-state-metrics, your feedback there could be helpful!
- https://github.com/crossplane/crossplane/pull/6865