PureStorage-OpenConnect / pure-exporter

Prometheus exporter for Pure Storage FlashArray and FlashBlade. DEPRECATED IN FAVOR OF FA AND FB OPENMETRICS EXPORTERS
Apache License 2.0
29 stars 20 forks source link

Fixed issue with no volume groups #30

Closed tothf closed 3 years ago

tothf commented 3 years ago

Since we have FlashArrays with PODs only we have no volume groups on those. I quickly put this fix together. Also noticed that the exporter called the API 6 times to get the same volume metrics. I've reduced this to 1 call and simply handing over the data to the different metric processors. Can be done for another few i think.

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Frank Toth seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

genegr commented 3 years ago

I have provided a fix to issue #29, while for this issue there is not any chance to lower the number of calls to the array API for the volumes, as the minimal combination for gathering all the KPIs is the one that is implemented in the current code. As a reference, I have put below the list of the calls that are made in sequence during a scrape request: the first 29 are just executed once for a given scrape, the last is instead executed in a loop over all the hosts. I wish there was a possibility to further reduce the number of API requests, but the rationale adopted in the current code is to extract all the KPIs minimizing the number of calls to the FlashArray (and FlashBlade).

flasharray.get() flasharray.list_hardware() flasharray.list_messages() flasharray.list_vgroups() flasharray.list_volumes(pending=true) flasharray.list_volumes(protocol_endpoint=True) flasharray.list_volumes(action='monitor') flasharray.list_volumes(action='monitor', mirrored=True) flasharray.list_volumes(action='monitor', latency=True) flasharray.list_volumes(action='monitor', latency=True, mirrored=True) flasharray.list_volumes(action='monitor', size=True) flasharray.list_volumes(action='monitor', size=True, mirrored=True) flasharray.list_volumes(space=True, pending=True) flasharray.list_hosts() flasharray.list_hosts(action='monitor') flasharray.list_hosts(action='monitor', mirrored=True) flasharray.list_hosts(action='monitor', latency=True) flasharray.list_hosts(action='monitor', latency=True, mirrored=True) flasharray.list_hosts(action='monitor', size=True) flasharray.list_hosts(action='monitor', size=True, mirrored=True) flasharray.list_hosts(space=True) flasharray.list_pods(pending=true) flasharray.list_pods(action='monitor') flasharray.list_pods(action='monitor', mirrored=True) flasharray.list_pods(action='monitor', latency=True) flasharray.list_pods(action='monitor', latency=True, mirrored=True) flasharray.list_pods(action='monitor', size=True) flasharray.list_pods(action='monitor', size=True, mirrored=True) flasharray.list_pods(space=True, pending=True) foreach host flasharray.list_host_connections(host)