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 metrics from Tinkoff libvirt exporter #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dmitry-Eremeev
Copy link

Added metrics from archived Tinkoff exporter:
libvirt_domain_block_stats_read_time_seconds_total
libvirt_domain_block_stats_write_time_seconds_total
libvirt_domain_block_stats_flush_requests_total
libvirt_domain_block_stats_flush_time_seconds_total
libvirt_domain_block_stats_capacity_bytes
libvirt_domain_memory_stats_used_percent
libvirt_domain_memory_stats_actual_balloon_bytes
libvirt_domain_memory_stats_major_fault_total
libvirt_domain_memory_stats_minor_fault_total

#22

@Knalltuete5000
Copy link
Collaborator

Knalltuete5000 commented Jan 24, 2025

Thanks for the contribution @Dmitry-Eremeev

  1. Could you be so kind to rebase your mr and adjust the logging. The common promtool library has changed the logging from go-kit/log to the new builtin library. These dependencies have been updated. For the usage you can refere to the main.go

  2. Have you tested your change on a system. I assume so, since you have adjusted the readme to include the new metrics

Thank you


// https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetAllDomainStats
if domainsBlockStats, err = l.ConnectGetAllDomainStats(domains, uint32(libvirt.DomainStatsBlock), 0); err != nil {
_ = level.Warn(logger).Log("warn", "failed to get additional block stats", "domain", domain.libvirtDomain.Name, "msg", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change to the new std logging system

Copy link
Author

Choose a reason for hiding this comment

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

done

statsIndex := "0"
var capacity, flushRequests, flushTimes, readTime, writeTime uint64
var prometheusDiskLabels []string
StatName := regexp.MustCompile(`block\.(\d+)\.(.+)`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to extract the regex in a static variable so the regex is not compiled on every function call

Copy link
Author

Choose a reason for hiding this comment

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

done

Added metrics from archived Tinkoff exporter:
libvirt_domain_block_stats_read_time_seconds_total
libvirt_domain_block_stats_write_time_seconds_total
libvirt_domain_block_stats_flush_requests_total
libvirt_domain_block_stats_flush_time_seconds_total
libvirt_domain_block_stats_capacity_bytes
libvirt_domain_memory_stats_used_percent
libvirt_domain_memory_stats_actual_balloon_bytes
libvirt_domain_memory_stats_major_fault_total
libvirt_domain_memory_stats_minor_fault_total

inovex#22
@Dmitry-Eremeev
Copy link
Author

Thanks for the contribution @Dmitry-Eremeev

  1. Could you be so kind to rebase your mr and adjust the logging. The common promtool library has changed the logging from go-kit/log to the new builtin library. These dependencies have been updated. For the usage you can refere to the main.go

done

  1. Have you tested your change on a system. I assume so, since you have adjusted the readme to include the new metrics

it's already there

Thank you

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.

2 participants