troubleshoot icon indicating copy to clipboard operation
troubleshoot copied to clipboard

Ensure clusterResources is added prior to other collectors

Open xavpaice opened this issue 3 years ago • 2 comments
trafficstars

If Troubleshoot adds the clusterResources or ClusterInfo collector, ensure that this is added at the first element of the collectors array.

Fixes: #767

xavpaice avatar Oct 10 '22 05:10 xavpaice

@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?

diamonwiggins avatar Oct 13 '22 00:10 diamonwiggins

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.

xavpaice avatar Oct 13 '22 00:10 xavpaice

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 👍

diamonwiggins avatar Oct 27 '22 14:10 diamonwiggins