chore: CI fixes

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2025-04-06 11:55:38 +02:00
parent 2c4698f119
commit 13d5e1cd12
2 changed files with 11 additions and 8 deletions

View File

@@ -8,11 +8,9 @@ on:
- master - master
- next - next
- main - main
- "0.*"
- "1.*"
pull_request: pull_request:
branches:
- master
- next
- main
env: env:
VERSION_PROMU: '0.14.0' VERSION_PROMU: '0.14.0'

View File

@@ -33,7 +33,12 @@ import (
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )
const Name = "net" const (
Name = "net"
subCollectorMetrics = "metrics"
subCollectorNicInfo = "nic_addresses"
)
type Config struct { type Config struct {
NicExclude *regexp.Regexp `yaml:"nic_exclude"` NicExclude *regexp.Regexp `yaml:"nic_exclude"`
@@ -46,8 +51,8 @@ var ConfigDefaults = Config{
NicExclude: types.RegExpEmpty, NicExclude: types.RegExpEmpty,
NicInclude: types.RegExpAny, NicInclude: types.RegExpAny,
CollectorsEnabled: []string{ CollectorsEnabled: []string{
"metrics", subCollectorMetrics,
"nic_addresses", subCollectorNicInfo,
}, },
} }
@@ -284,7 +289,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
} }
if slices.Contains(c.config.CollectorsEnabled, subCollectorNicInfo) { if slices.Contains(c.config.CollectorsEnabled, subCollectorNicInfo) {
if err := c.collectNICInfo(ch); err != nil { if err := c.collectNICAddresses(ch); err != nil {
errs = append(errs, fmt.Errorf("failed collecting net addresses: %w", err)) errs = append(errs, fmt.Errorf("failed collecting net addresses: %w", err))
} }
} }