mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
6
.github/workflows/lint.yml
vendored
6
.github/workflows/lint.yml
vendored
@@ -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'
|
||||||
|
|||||||
@@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user