hashicorp / hcdiag

hcdiag is a CLI utility that collects and bundles product and platform diagnostics. It supports Consul, Nomad, TFE, and Vault.
Mozilla Public License 2.0
56 stars 8 forks source link

Iterate on lists #179

Open anniehedgpeth opened 2 years ago

anniehedgpeth commented 2 years ago

What problem would you like hcdiag to address?
In conjunction with the feature request for Conditional Support to retrieve nested metrics, I would like to be able to run metrics for entire lists found in the output.

Who is the audience for this request?
TFE product and engineering team

What would the ideal solution look like?
In the section of my RFC titled "TFE Product Usage via Atlas Settings", there are several pieces of data that I would need on each organization. I would like to be able to use the httper to grab a list of all of the organizations in a TFE instance and iterate on those organizations to run the httper to get info on agents, workflows, and VCS providers.

For example, I would like to know the total number of agents at the time of collection. In order to do that, I would need to do the following:

What alternatives have you considered?
Hammering it out with bash or creating my own iteration function in the TFE product.

What is the impact?
As referenced in our PRD, we are collecting aggregate data on our customers across the board, so being able to dig into this data for each customer is important, and collecting data on those totals for our research is important for our testing strategies.

aliciaclark1066 commented 2 years ago

Thanks Annie! This is great info for us. We'll take a look and get back to you soon on when we can prioritize this request.

anniehedgpeth commented 2 years ago

After looking at the API response, I see that the agents' "status-counts" would be the end result of what I would want, given that example up above, so aggregating a total for all agents would simply be adding the "status-counts" for all organizations.

I understand that this is a bigger conversation with how the data collected is parsed and stored, but I just wanted to drop in an example of how we'd want to use it.

anniehedgpeth commented 2 years ago

I edited the original post to remove aggregation.

aliciaclark1066 commented 2 years ago

Hi @anniehedgpeth! Our upcoming dynamic runners epic should be able to address this feature. We'll make sure to add it to our list of use cases.