Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dmslave_info textfile collector #6

Closed

Conversation

ssinha-ionos
Copy link
Contributor

Add textfile collector to count the number of lun devices associated
with device-mapper slaves and expose as Prometheus metrics.

Signed-off-by: Saket Sinha saket.sinha@cloud.ionos.com

Add textfile collector to count the number of lun devices associated
with device-mapper slaves and expose as Prometheus metrics.

Signed-off-by: Saket Sinha <saket.sinha@cloud.ionos.com>

dm = [x for x in os.listdir(sysfs+'virtual/block/') if x.startswith('dm')]
for dx in dm:
dm_sd = os.listdir(sysfs+'virtual/block/'+dx+'/slaves/')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.join() would be a more Pythonic way of doing this.

['dm_device', 'lun_name'],
registry=registry)

dm = [x for x in os.listdir(sysfs+'virtual/block/') if x.startswith('dm')]
Copy link
Member

@dswarbrick dswarbrick Sep 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use glob.glob(sysfs+'virtual/block/dm-*') combined with os.path.basename() ?

@dswarbrick
Copy link
Member

Obsoleted by prometheus/procfs#412

I think we can close this.

@dswarbrick
Copy link
Member

Closing as obsolete.

@dswarbrick dswarbrick closed this May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants