diff --git a/sources/procfs.go b/sources/procfs.go index adab4436..f5ef66fb 100644 --- a/sources/procfs.go +++ b/sources/procfs.go @@ -134,68 +134,68 @@ func newLustreProcMetric(filename string, promName string, source string, path s func (s *lustreSource) generateOSTMetricTemplates() error { metricMap := map[string][]lustreHelpStruct{ "obdfilter/*": { - {"blocksize", "blocksize", "Filesystem block size in bytes", s.counterMetric}, - {"brw_size", "brw_size", "Block read/write size in megabytes", s.counterMetric}, - {"brw_stats", "pages_per_bulk_rw", pagesPerBlockRWHelp, s.counterMetric}, - {"brw_stats", "discontiguous_pages", discontiguousPagesHelp, s.counterMetric}, - {"brw_stats", "disk_ios_in_flight", diskIOsInFlightHelp, s.counterMetric}, - {"brw_stats", "io_time", ioTimeHelp, s.counterMetric}, - {"brw_stats", "disk_io_size", diskIOSizeHelp, s.counterMetric}, - {"degraded", "degraded", "Binary indicator as to whether or not the pool is degraded - 0 for not degraded, 1 for degraded", s.counterMetric}, - {"filesfree", "filesfree", "The number of inodes (objects) available", s.counterMetric}, - {"filestotal", "filestotal", "The maximum number of inodes (objects) the filesystem can hold", s.counterMetric}, - {"grant_compat_disable", "grant_compat_disable", "Binary indicator as to whether clients with OBD_CONNECT_GRANT_PARAM setting will be granted space", s.counterMetric}, - {"grant_precreate", "grant_precreate", "Maximum space in bytes that clients can preallocate for objects", s.counterMetric}, - {"job_cleanup_interval", "job_cleanup_interval", "Interval in seconds between cleanup of tuning statistics", s.counterMetric}, - {"job_stats", "job_read_samples", readSamplesHelp, s.counterMetric}, - {"job_stats", "job_read_minimum", readMinimumHelp, s.counterMetric}, - {"job_stats", "job_read_maximum", readMaximumHelp, s.counterMetric}, - {"job_stats", "job_read_total", readTotalHelp, s.counterMetric}, - {"job_stats", "job_write_samples", writeSamplesHelp, s.counterMetric}, - {"job_stats", "job_write_minimum", writeMinimumHelp, s.counterMetric}, - {"job_stats", "job_write_maximum", writeMaximumHelp, s.counterMetric}, - {"job_stats", "job_write_total", writeTotalHelp, s.counterMetric}, - {"job_stats", "job_num_getattr", getattrHelp, s.counterMetric}, - {"job_stats", "job_num_setattr", setattrHelp, s.counterMetric}, - {"job_stats", "job_num_punch", punchHelp, s.counterMetric}, - {"job_stats", "job_num_sync", syncHelp, s.counterMetric}, - {"job_stats", "job_num_destroy", destroyHelp, s.counterMetric}, - {"job_stats", "job_num_create", createHelp, s.counterMetric}, - {"job_stats", "job_num_statfs", statfsHelp, s.counterMetric}, - {"job_stats", "job_num_get_info", getInfoHelp, s.counterMetric}, - {"job_stats", "job_num_set_info", setInfoHelp, s.counterMetric}, - {"job_stats", "job_num_quotactl", quotactlHelp, s.counterMetric}, - {"kbytesavail", "kbytesavail", "Number of kilobytes readily available in the pool", s.counterMetric}, - {"kbytesfree", "kbytesfree", "Number of kilobytes allocated to the pool", s.counterMetric}, - {"kbytestotal", "kbytestotal", "Capacity of the pool in kilobytes", s.counterMetric}, - {"lfsck_speed_limit", "lfsck_speed_limit", "Maximum operations per second LFSCK (Lustre filesystem verification) can run", s.counterMetric}, - {"num_exports", "num_exports", "Total number of times the pool has been exported", s.counterMetric}, - {"precreate_batch", "precreate_batch", "Maximum number of objects that can be included in a single transaction", s.counterMetric}, - {"recovery_time_hard", "recovery_time_hard", "Maximum timeout 'recover_time_soft' can increment to for a single server", s.counterMetric}, - {"recovery_time_soft", "recovery_time_soft", "Duration in seconds for a client to attempt to reconnect after a crash (automatically incremented if servers are still in an error state)", s.counterMetric}, - {"soft_sync_limit", "soft_sync_limit", "Number of RPCs necessary before triggering a sync", s.counterMetric}, + {"blocksize", "blocksize_bytes", "Filesystem block size in bytes", s.gaugeMetric}, + {"brw_size", "brw_size_megabytes", "Block read/write size in megabytes", s.gaugeMetric}, + {"brw_stats", "pages_per_bulk_rw_total", pagesPerBlockRWHelp, s.counterMetric}, + {"brw_stats", "discontiguous_pages_total", discontiguousPagesHelp, s.counterMetric}, + {"brw_stats", "disk_io_now", diskIOsInFlightHelp, s.gaugeMetric}, + {"brw_stats", "io_time_milliseconds_total", ioTimeHelp, s.counterMetric}, + {"brw_stats", "disk_io_total", diskIOSizeHelp, s.counterMetric}, + {"degraded", "degraded_now", "Binary indicator as to whether or not the pool is degraded - 0 for not degraded, 1 for degraded", s.gaugeMetric}, + {"filesfree", "files_free_now", "The number of inodes (objects) available", s.gaugeMetric}, + {"filestotal", "file_capacity", "The maximum number of inodes (objects) the filesystem can hold", s.gaugeMetric}, + {"grant_compat_disable", "grant_compat_disabled", "Binary indicator as to whether clients with OBD_CONNECT_GRANT_PARAM setting will be granted space", s.gaugeMetric}, + {"grant_precreate", "grant_precreate_capacity_bytes", "Maximum space in bytes that clients can preallocate for objects", s.gaugeMetric}, + {"job_cleanup_interval", "job_cleanup_interval_seconds", "Interval in seconds between cleanup of tuning statistics", s.gaugeMetric}, + {"job_stats", "job_read_samples_total", readSamplesHelp, s.counterMetric}, + {"job_stats", "job_read_minimum_size_bytes", readMinimumHelp, s.gaugeMetric}, + {"job_stats", "job_read_maximum_size_bytes", readMaximumHelp, s.gaugeMetric}, + {"job_stats", "job_read_bytes_total", readTotalHelp, s.counterMetric}, + {"job_stats", "job_write_samples_total", writeSamplesHelp, s.counterMetric}, + {"job_stats", "job_write_minimum_size_bytes", writeMinimumHelp, s.gaugeMetric}, + {"job_stats", "job_write_maximum_size_bytes", writeMaximumHelp, s.gaugeMetric}, + {"job_stats", "job_write_bytes_total", writeTotalHelp, s.counterMetric}, + {"job_stats", "job_getattr_total", getattrHelp, s.counterMetric}, + {"job_stats", "job_setattr_total", setattrHelp, s.counterMetric}, + {"job_stats", "job_punch_total", punchHelp, s.counterMetric}, + {"job_stats", "job_sync_total", syncHelp, s.counterMetric}, + {"job_stats", "job_destroy_total", destroyHelp, s.counterMetric}, + {"job_stats", "job_create_total", createHelp, s.counterMetric}, + {"job_stats", "job_statfs_total", statfsHelp, s.counterMetric}, + {"job_stats", "job_get_info_total", getInfoHelp, s.counterMetric}, + {"job_stats", "job_set_info_total", setInfoHelp, s.counterMetric}, + {"job_stats", "job_quotactl_total", quotactlHelp, s.counterMetric}, + {"kbytesavail", "kilobytes_available_now", "Number of kilobytes readily available in the pool", s.gaugeMetric}, + {"kbytesfree", "kilobytes_free_now", "Number of kilobytes allocated to the pool", s.gaugeMetric}, + {"kbytestotal", "kilobytes_capacity", "Capacity of the pool in kilobytes", s.gaugeMetric}, + {"lfsck_speed_limit", "lfsck_speed_limit", "Maximum operations per second LFSCK (Lustre filesystem verification) can run", s.gaugeMetric}, + {"num_exports", "exports_total", "Total number of times the pool has been exported", s.counterMetric}, + {"precreate_batch", "precreate_batch", "Maximum number of objects that can be included in a single transaction", s.gaugeMetric}, + {"recovery_time_hard", "recovery_time_hard_seconds", "Maximum timeout 'recover_time_soft' can increment to for a single server", s.gaugeMetric}, + {"recovery_time_soft", "recovery_time_soft_seconds", "Duration in seconds for a client to attempt to reconnect after a crash (automatically incremented if servers are still in an error state)", s.gaugeMetric}, + {"soft_sync_limit", "soft_sync_limit", "Number of RPCs necessary before triggering a sync", s.gaugeMetric}, {"stats", "read_samples_total", readSamplesHelp, s.counterMetric}, - {"stats", "read_minimum_size_bytes", readMinimumHelp, s.counterMetric}, - {"stats", "read_maximum_size_bytes", readMaximumHelp, s.counterMetric}, - {"stats", "read_total_bytes", readTotalHelp, s.counterMetric}, + {"stats", "read_minimum_size_bytes", readMinimumHelp, s.gaugeMetric}, + {"stats", "read_maximum_size_bytes", readMaximumHelp, s.gaugeMetric}, + {"stats", "read_bytes_total", readTotalHelp, s.counterMetric}, {"stats", "write_samples_total", writeSamplesHelp, s.counterMetric}, - {"stats", "write_minimum_size_bytes", writeMinimumHelp, s.counterMetric}, - {"stats", "write_maximum_size_bytes", writeMaximumHelp, s.counterMetric}, - {"stats", "write_total_bytes", writeTotalHelp, s.counterMetric}, - {"sync_journal", "sync_journal", "Binary indicator as to whether or not the journal is set for asynchronous commits", s.counterMetric}, - {"tot_dirty", "tot_dirty", "Total number of exports that have been marked dirty", s.counterMetric}, - {"tot_granted", "tot_granted", "Total number of exports that have been marked granted", s.counterMetric}, - {"tot_pending", "tot_pending", "Total number of exports that have been marked pending", s.counterMetric}, + {"stats", "write_minimum_size_bytes", writeMinimumHelp, s.gaugeMetric}, + {"stats", "write_maximum_size_bytes", writeMaximumHelp, s.gaugeMetric}, + {"stats", "write_bytes_total", writeTotalHelp, s.counterMetric}, + {"sync_journal", "sync_journal_enabled", "Binary indicator as to whether or not the journal is set for asynchronous commits", s.gaugeMetric}, + {"tot_dirty", "exports_dirty_total", "Total number of exports that have been marked dirty", s.counterMetric}, + {"tot_granted", "exports_granted_total", "Total number of exports that have been marked granted", s.counterMetric}, + {"tot_pending", "exports_pending_total", "Total number of exports that have been marked pending", s.counterMetric}, }, "ldlm/namespaces/filter-*": { - {"lock_count", "lock_count", "Number of locks", s.counterMetric}, - {"lock_timeouts", "lock_timeouts", "Number of lock timeouts", s.counterMetric}, - {"contended_locks", "contended_locks", "Number of contended locks", s.counterMetric}, - {"contention_seconds", "contention_seconds", "Time in seconds during which locks were contended", s.counterMetric}, - {"pool/granted", "granted", "Number of granted locks", s.counterMetric}, - {"pool/grant_rate", "grant_rate", "Lock grant rate", s.counterMetric}, - {"pool/cancel_rate", "cancel_rate", "Lock cancel rate", s.counterMetric}, - {"pool/grant_speed", "grant_speed", "Lock grant speed", s.counterMetric}, + {"lock_count", "lock_count_total", "Number of locks", s.counterMetric}, + {"lock_timeouts", "lock_timeout_total", "Number of lock timeouts", s.counterMetric}, + {"contended_locks", "lock_contended_total", "Number of contended locks", s.counterMetric}, + {"contention_seconds", "lock_contention_seconds_total", "Time in seconds during which locks were contended", s.counterMetric}, + {"pool/granted", "locks_granted_total", "Number of granted locks", s.counterMetric}, + {"pool/grant_rate", "lock_grant_rate", "Lock grant rate", s.gaugeMetric}, + {"pool/cancel_rate", "lock_cancel_rate", "Lock cancel rate", s.gaugeMetric}, + {"pool/grant_speed", "lock_grant_speed", "Lock grant speed", s.gaugeMetric}, }, } for path := range metricMap { @@ -210,39 +210,39 @@ func (s *lustreSource) generateOSTMetricTemplates() error { func (s *lustreSource) generateMDTMetricTemplates() error { metricMap := map[string][]lustreHelpStruct{ "mdt/*": { - {"md_stats", "mdt_opens", openHelp, s.counterMetric}, - {"md_stats", "mdt_closes", closeHelp, s.counterMetric}, - {"md_stats", "mdt_getattrs", getattrHelp, s.counterMetric}, - {"md_stats", "mdt_setattrs", setattrHelp, s.counterMetric}, - {"md_stats", "mdt_getxattrs", getxattrHelp, s.counterMetric}, - {"md_stats", "mdt_setxattrs", setxattrHelp, s.counterMetric}, - {"md_stats", "mdt_statfs", statfsHelp, s.counterMetric}, - {"md_stats", "mdt_mknod", mknodHelp, s.counterMetric}, - {"md_stats", "mdt_link", linkHelp, s.counterMetric}, - {"md_stats", "mdt_unlink", unlinkHelp, s.counterMetric}, - {"md_stats", "mdt_mkdir", mkdirHelp, s.counterMetric}, - {"md_stats", "mdt_rmdir", rmdirHelp, s.counterMetric}, - {"md_stats", "mdt_rename", renameHelp, s.counterMetric}, - {"md_stats", "mdt_sync", syncHelp, s.counterMetric}, - {"md_stats", "mdt_samedir_rename", samedirRenameHelp, s.counterMetric}, - {"md_stats", "mdt_crossdir_rename", crossdirRenameHelp, s.counterMetric}, - {"num_exports", "num_exports", "Total number of times the pool has been exported", s.counterMetric}, - {"job_stats", "num_opens", openHelp, s.counterMetric}, - {"job_stats", "num_closes", closeHelp, s.counterMetric}, - {"job_stats", "num_mknod", mknodHelp, s.counterMetric}, - {"job_stats", "num_link", linkHelp, s.counterMetric}, - {"job_stats", "num_unlink", unlinkHelp, s.counterMetric}, - {"job_stats", "num_mkdir", mkdirHelp, s.counterMetric}, - {"job_stats", "num_rmdir", rmdirHelp, s.counterMetric}, - {"job_stats", "num_rename", renameHelp, s.counterMetric}, - {"job_stats", "num_getattr", getattrHelp, s.counterMetric}, - {"job_stats", "num_setattr", setattrHelp, s.counterMetric}, - {"job_stats", "num_getxattr", getxattrHelp, s.counterMetric}, - {"job_stats", "num_setxattr", setxattrHelp, s.counterMetric}, - {"job_stats", "num_statfs", statfsHelp, s.counterMetric}, - {"job_stats", "num_sync", syncHelp, s.counterMetric}, - {"job_stats", "num_samedir_rename", samedirRenameHelp, s.counterMetric}, - {"job_stats", "num_crossdir_rename", crossdirRenameHelp, s.counterMetric}, + {"md_stats", "open_total", openHelp, s.counterMetric}, + {"md_stats", "close_total", closeHelp, s.counterMetric}, + {"md_stats", "getattr_total", getattrHelp, s.counterMetric}, + {"md_stats", "setattr_total", setattrHelp, s.counterMetric}, + {"md_stats", "getxattr_total", getxattrHelp, s.counterMetric}, + {"md_stats", "setxattr_total", setxattrHelp, s.counterMetric}, + {"md_stats", "statfs_total", statfsHelp, s.counterMetric}, + {"md_stats", "mknod_total", mknodHelp, s.counterMetric}, + {"md_stats", "link_total", linkHelp, s.counterMetric}, + {"md_stats", "unlink_total", unlinkHelp, s.counterMetric}, + {"md_stats", "mkdir_total", mkdirHelp, s.counterMetric}, + {"md_stats", "rmdir_total", rmdirHelp, s.counterMetric}, + {"md_stats", "rename_total", renameHelp, s.counterMetric}, + {"md_stats", "sync_total", syncHelp, s.counterMetric}, + {"md_stats", "samedir_rename_total", samedirRenameHelp, s.counterMetric}, + {"md_stats", "crossdir_rename_total", crossdirRenameHelp, s.counterMetric}, + {"num_exports", "exports_total", "Total number of times the pool has been exported", s.counterMetric}, + {"job_stats", "job_open_total", openHelp, s.counterMetric}, + {"job_stats", "job_close_total", closeHelp, s.counterMetric}, + {"job_stats", "job_mknod_total", mknodHelp, s.counterMetric}, + {"job_stats", "job_link_total", linkHelp, s.counterMetric}, + {"job_stats", "job_unlink_total", unlinkHelp, s.counterMetric}, + {"job_stats", "job_mkdir_total", mkdirHelp, s.counterMetric}, + {"job_stats", "job_rmdir_total", rmdirHelp, s.counterMetric}, + {"job_stats", "job_rename_total", renameHelp, s.counterMetric}, + {"job_stats", "job_getattr_total", getattrHelp, s.counterMetric}, + {"job_stats", "job_setattr_total", setattrHelp, s.counterMetric}, + {"job_stats", "job_getxattr_total", getxattrHelp, s.counterMetric}, + {"job_stats", "job_setxattr_total", setxattrHelp, s.counterMetric}, + {"job_stats", "job_statfs_total", statfsHelp, s.counterMetric}, + {"job_stats", "job_sync_total", syncHelp, s.counterMetric}, + {"job_stats", "job_samedir_rename_total", samedirRenameHelp, s.counterMetric}, + {"job_stats", "job_crossdir_rename_total", crossdirRenameHelp, s.counterMetric}, }, } for path := range metricMap { @@ -257,13 +257,13 @@ func (s *lustreSource) generateMDTMetricTemplates() error { func (s *lustreSource) generateMGSMetricTemplates() error { metricMap := map[string][]lustreHelpStruct{ "mgs/MGS/osd/": { - {"blocksize", "blocksize", "Filesystem block size in bytes", s.counterMetric}, - {"filesfree", "filesfree", "The number of inodes (objects) available", s.counterMetric}, - {"filestotal", "filestotal", "The maximum number of inodes (objects) the filesystem can hold", s.counterMetric}, - {"kbytesavail", "kbytesavail", "Number of kilobytes readily available in the pool", s.counterMetric}, - {"kbytesfree", "kbytesfree", "Number of kilobytes allocated to the pool", s.counterMetric}, - {"kbytestotal", "kbytestotal", "Capacity of the pool in kilobytes", s.counterMetric}, - {"quota_iused_estimate", "quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated", s.counterMetric}, + {"blocksize", "blocksize_bytes", "Filesystem block size in bytes", s.gaugeMetric}, + {"filesfree", "files_free_now", "The number of inodes (objects) available", s.gaugeMetric}, + {"filestotal", "file_capacity", "The maximum number of inodes (objects) the filesystem can hold", s.gaugeMetric}, + {"kbytesavail", "kilobytes_available_now", "Number of kilobytes readily available in the pool", s.gaugeMetric}, + {"kbytesfree", "kilobytes_free_now", "Number of kilobytes allocated to the pool", s.gaugeMetric}, + {"kbytestotal", "kilobytes_capacity", "Capacity of the pool in kilobytes", s.gaugeMetric}, + {"quota_iused_estimate", "quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated", s.gaugeMetric}, }, } for path := range metricMap { @@ -278,13 +278,13 @@ func (s *lustreSource) generateMGSMetricTemplates() error { func (s *lustreSource) generateMDSMetricTemplates() error { metricMap := map[string][]lustreHelpStruct{ "mds/MDS/osd": { - {"blocksize", "blocksize", "Filesystem block size in bytes", s.counterMetric}, - {"filesfree", "filesfree", "The number of inodes (objects) available", s.counterMetric}, - {"filestotal", "filestotal", "The maximum number of inodes (objects) the filesystem can hold", s.counterMetric}, - {"kbytesavail", "kbytesavail", "Number of kilobytes readily available in the pool", s.counterMetric}, - {"kbytesfree", "kbytesfree", "Number of kilobytes allocated to the pool", s.counterMetric}, - {"kbytestotal", "kbytestotal", "Capacity of the pool in kilobytes", s.counterMetric}, - {"quota_iused_estimate", "quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated", s.counterMetric}, + {"blocksize", "blocksize_bytes", "Filesystem block size in bytes", s.gaugeMetric}, + {"filesfree", "files_free_now", "The number of inodes (objects) available", s.gaugeMetric}, + {"filestotal", "file_capacity", "The maximum number of inodes (objects) the filesystem can hold", s.gaugeMetric}, + {"kbytesavail", "kilobytes_available_now", "Number of kilobytes readily available in the pool", s.gaugeMetric}, + {"kbytesfree", "kilobytes_free_now", "Number of kilobytes allocated to the pool", s.gaugeMetric}, + {"kbytestotal", "kilobytes_capacity", "Capacity of the pool in kilobytes", s.gaugeMetric}, + {"quota_iused_estimate", "quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated", s.gaugeMetric}, }, } for path := range metricMap {