troubleshoot
troubleshoot copied to clipboard
Ensure clusterResources is added prior to other collectors
If Troubleshoot adds the clusterResources or ClusterInfo collector, ensure that this is added at the first element of the collectors array.
Fixes: #767
@xavpaice just curious. did something happen where the ordering mattered here? Or is the concern that troubleshoot could completely fail on other collectors so we want to capture these as soon as possible?
switched to draft:
- there's 3 different ensureCollectorInList functions
- suggestion was to make it so that we have a function that takes a list of collectors, finds the one we want, and moves it to the beginning, then use that resulting list to execute the collectors themselves.
The newly added function makes sense to me. I was wondering if it could benefit from being a more general sort function that could take any collector as input, but i don't think I envision a use case for this outside of clusterResources 👍