hansmi / prometheus-lvm-exporter

Prometheus exporter for LVM metrics.
BSD 3-Clause "New" or "Revised" License
22 stars 5 forks source link

Treat ancestors/descendents as info rather than metrics. #2

Closed dsnt02518 closed 2 years ago

dsnt02518 commented 2 years ago

Fixes issue #1

hansmi commented 2 years ago

Thank you for your contribution! Overall the changes look good.

Can you please add a separate testdata file with populated lv_ancestors, lv_descendants, lv_full_ancestors and lv_full_descendants fields? Feel free to obfuscate as necessary. The command below produces a suitable test file. The code is written to not require anything but the UUID. jq is used to indent the data consistent with the existing files.

/usr/sbin/lvm fullreport --all --config 'global/suffix=false global/units=b report/binary_values_as_numeric=1 report/output_format=json report/buffered=false report/time_format=%s' --configreport pv --options -all --configreport lv --options lv_uuid,lv_name,lv_ancestors,lv_descendants,lv_full_ancestors,lv_full_descendants --configreport vg --options -all --configreport seg --options -all --configreport pvseg --options -all | \
jq -M
dsnt02518 commented 2 years ago

No problem. I've added 'snapshot' testdata/golden output files and added to collector_test.go - let me know if any of that isn't right.

On Thu, 2 Dec 2021 at 20:33, hansmi @.***> wrote:

Thank you for your contribution! Overall the changes look good.

Can you please add a separate testdata file with populated lv_ancestors, lv_descendants, lv_full_ancestors and lv_full_descendants fields? Feel free to obfuscate as necessary. The command below produces a suitable test file. The code is written to not require anything but the UUID. jq is used to indent the data consistent with the existing files.

/usr/sbin/lvm fullreport --all --config 'global/suffix=false global/units=b report/binary_values_as_numeric=1 report/output_format=json report/buffered=false report/time_format=%s' --configreport pv --options -all --configreport lv --options lv_uuid,lv_name,lv_ancestors,lv_descendants,lv_full_ancestors,lv_full_descendants --configreport vg --options -all --configreport seg --options -all --configreport pvseg --options -all | \ jq -M

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hansmi/prometheus-lvm-exporter/pull/2#issuecomment-984979198, or unsubscribe https://github.com/notifications/unsubscribe-auth/AETQITOMWTQJ5M7CEVZY2J3UO7JXZANCNFSM5JGSRDCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.