Embedded types should be at the top of the field list of a struct.

And there should be an empty line separating embedded fields from regular fields
This commit is contained in:
Holger Obermaier
2026-02-16 10:54:12 +01:00
parent 83720aa5be
commit 40fe94cabb
30 changed files with 29 additions and 13 deletions

View File

@@ -37,6 +37,7 @@ type BeegfsMetaCollectorConfig struct {
type BeegfsMetaCollector struct {
metricCollector
tags map[string]string
matches map[string]string
config BeegfsMetaCollectorConfig

View File

@@ -35,6 +35,7 @@ type BeegfsStorageCollectorConfig struct {
type BeegfsStorageCollector struct {
metricCollector
tags map[string]string
matches map[string]string
config BeegfsStorageCollectorConfig

View File

@@ -32,6 +32,7 @@ type CPUFreqCpuInfoCollectorTopology struct {
type CPUFreqCpuInfoCollector struct {
metricCollector
topology []CPUFreqCpuInfoCollectorTopology
}

View File

@@ -35,6 +35,7 @@ type CPUFreqCollectorTopology struct {
// See: https://www.kernel.org/doc/html/latest/admin-guide/pm/cpufreq.html
type CPUFreqCollector struct {
metricCollector
topology []CPUFreqCollectorTopology
config struct {
ExcludeMetrics []string `json:"exclude_metrics,omitempty"`

View File

@@ -30,6 +30,7 @@ type CpustatCollectorConfig struct {
type CpustatCollector struct {
metricCollector
config CpustatCollectorConfig
lastTimestamp time.Time // Store time stamp of last tick to derive values
matches map[string]int

View File

@@ -31,6 +31,7 @@ type CustomCmdCollectorConfig struct {
type CustomCmdCollector struct {
metricCollector
config CustomCmdCollectorConfig
cmdFieldsSlice [][]string
files []string

View File

@@ -29,6 +29,7 @@ type DiskstatCollectorConfig struct {
type DiskstatCollector struct {
metricCollector
config DiskstatCollectorConfig
allowedMetrics map[string]bool
}

View File

@@ -52,6 +52,7 @@ type GpfsMetricDefinition struct {
type GpfsCollector struct {
metricCollector
tags map[string]string
config GpfsCollectorConfig
sudoCmd string

View File

@@ -46,6 +46,7 @@ type InfinibandCollectorInfo struct {
type InfinibandCollector struct {
metricCollector
config struct {
ExcludeDevices []string `json:"exclude_devices,omitempty"` // IB device to exclude e.g. mlx5_0
SendAbsoluteValues bool `json:"send_abs_values"` // Send absolut values as read from sys filesystem

View File

@@ -37,6 +37,7 @@ type IOstatCollectorEntry struct {
type IOstatCollector struct {
metricCollector
matches map[string]int
config IOstatCollectorConfig
devices map[string]IOstatCollectorEntry

View File

@@ -27,6 +27,7 @@ const IPMISENSORS_PATH = `ipmi-sensors`
type IpmiCollector struct {
metricCollector
config struct {
ExcludeDevices []string `json:"exclude_devices"`
IpmitoolPath string `json:"ipmitool_path"`

View File

@@ -30,6 +30,7 @@ const LOADAVGFILE = "/proc/loadavg"
type LoadavgCollector struct {
metricCollector
tags map[string]string
load_matches []string
load_skips []bool

View File

@@ -45,6 +45,7 @@ type LustreMetricDefinition struct {
type LustreCollector struct {
metricCollector
tags map[string]string
config LustreCollectorConfig
lctl string

View File

@@ -40,6 +40,7 @@ type MemstatCollectorNode struct {
type MemstatCollector struct {
metricCollector
stats map[string]int64
tags map[string]string
matches map[string]string

View File

@@ -41,6 +41,7 @@ type NetstatCollectorMetric struct {
type NetstatCollector struct {
metricCollector
config NetstatCollectorConfig
aliasToCanonical map[string]string
matches map[string][]NetstatCollectorMetric

View File

@@ -34,6 +34,7 @@ type NfsCollectorData struct {
type nfsCollector struct {
metricCollector
tags map[string]string
version string
config struct {

View File

@@ -34,6 +34,7 @@ type NfsIOStatCollectorConfig struct {
// defined by metricCollector (name, init, ...)
type NfsIOStatCollector struct {
metricCollector
config NfsIOStatCollectorConfig // the configuration structure
meta map[string]string // default meta information
tags map[string]string // default tags

View File

@@ -59,6 +59,7 @@ type NUMAStatsCollectorTopolgy struct {
type NUMAStatsCollector struct {
metricCollector
topology []NUMAStatsCollectorTopolgy
config NUMAStatsCollectorConfig
lastTimestamp time.Time

View File

@@ -47,6 +47,7 @@ type NvidiaCollectorDevice struct {
type NvidiaCollector struct {
metricCollector
config NvidiaCollectorConfig
gpus []NvidiaCollectorDevice
num_gpus int

View File

@@ -34,6 +34,7 @@ type RAPLZoneInfo struct {
type RAPLCollector struct {
metricCollector
config struct {
// Exclude IDs for RAPL zones, e.g.
// * 0 for zone 0

View File

@@ -38,6 +38,7 @@ type RocmSmiCollectorDevice struct {
type RocmSmiCollector struct {
metricCollector
config RocmSmiCollectorConfig // the configuration structure
devices []RocmSmiCollectorDevice
}

View File

@@ -25,6 +25,7 @@ type SampleCollectorConfig struct {
// defined by metricCollector (name, init, ...)
type SampleCollector struct {
metricCollector
config SampleCollectorConfig // the configuration structure
meta map[string]string // default meta information
tags map[string]string // default tags

View File

@@ -26,6 +26,7 @@ type SampleTimerCollectorConfig struct {
// defined by metricCollector (name, init, ...)
type SampleTimerCollector struct {
metricCollector
wg sync.WaitGroup // sync group for management
done chan bool // channel for management
meta map[string]string // default meta information

View File

@@ -31,6 +31,7 @@ type SchedstatCollectorConfig struct {
// defined by metricCollector (name, init, ...)
type SchedstatCollector struct {
metricCollector
config SchedstatCollectorConfig // the configuration structure
lastTimestamp time.Time // Store time stamp of last tick to derive values
meta map[string]string // default meta information

View File

@@ -27,6 +27,7 @@ type SelfCollectorConfig struct {
type SelfCollector struct {
metricCollector
config SelfCollectorConfig // the configuration structure
meta map[string]string // default meta information
tags map[string]string // default tags

View File

@@ -32,6 +32,7 @@ type SlurmCgroupsConfig struct {
type SlurmCgroupCollector struct {
metricCollector
config SlurmCgroupsConfig
meta map[string]string
tags map[string]string

View File

@@ -41,6 +41,7 @@ type TempCollectorSensor struct {
type TempCollector struct {
metricCollector
config struct {
ExcludeMetrics []string `json:"exclude_metrics"`
TagOverride map[string]map[string]string `json:"tag_override"`

View File

@@ -27,6 +27,7 @@ type TopProcsCollectorConfig struct {
type TopProcsCollector struct {
metricCollector
tags map[string]string
config TopProcsCollectorConfig
}