Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Gauges = []prometheus.GaugeDefinition{ { Name: []string{"host", "memory", "total"}, Help: "Total physical memory in bytes", }, { Name: []string{"host", "memory", "available"}, Help: "Available physical memory in bytes", }, { Name: []string{"host", "memory", "free"}, Help: "Free physical memory in bytes", }, { Name: []string{"host", "memory", "used"}, Help: "Used physical memory in bytes", }, { Name: []string{"host", "memory", "used_percent"}, Help: "Percentage of physical memory in use", }, { Name: []string{"host", "cpu", "total"}, Help: "Total cpu utilization", }, { Name: []string{"host", "cpu", "user"}, Help: "User cpu utilization", }, { Name: []string{"host", "cpu", "idle"}, Help: "Idle cpu utilization", }, { Name: []string{"host", "cpu", "iowait"}, Help: "Iowait cpu utilization", }, { Name: []string{"host", "cpu", "system"}, Help: "System cpu utilization", }, { Name: []string{"host", "disk", "size"}, Help: "Size of disk in bytes", }, { Name: []string{"host", "disk", "used"}, Help: "Disk usage in bytes", }, { Name: []string{"host", "disk", "available"}, Help: "Available bytes on disk", }, { Name: []string{"host", "disk", "used_percent"}, Help: "Percentage of disk space usage", }, { Name: []string{"host", "disk", "inodes_percent"}, Help: "Percentage of disk inodes usage", }, { Name: []string{"host", "uptime"}, Help: "System uptime", }, }
Functions ¶
This section is empty.
Types ¶
type CPUStats ¶
type CPUStats struct { CPU string User float64 System float64 Idle float64 Iowait float64 Total float64 }
CPUStats represents hoststats related to cpu usage
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector collects host resource usage stats
func NewCollector ¶
func NewCollector(ctx context.Context, logger hclog.Logger, dataDir string, opts ...CollectorOption) *Collector
NewCollector returns a Collector. The dataDir is passed in so that we can present the disk related statistics for the mountpoint where the dataDir exists
type CollectorOption ¶
type CollectorOption func(c *Collector)
func WithBaseLabels ¶
func WithBaseLabels(labels []metrics.Label) CollectorOption
func WithMetrics ¶
func WithMetrics(m *metrics.Metrics) CollectorOption
type DiskStats ¶
type DiskStats struct { Path string Size uint64 Used uint64 Available uint64 UsedPercent float64 InodesUsedPercent float64 }
DiskStats represents hoststats related to disk usage
type HostStats ¶
type HostStats struct { Memory *MemoryStats CPU []*CPUStats DataDirStats *DiskStats Uptime uint64 Timestamp int64 }
HostStats represents resource usage hoststats of the host running a Consul agent
Click to show internal directories.
Click to hide internal directories.