diff --git a/collector/fixtures/proc/10/net b/collector/fixtures/proc/10/net new file mode 120000 index 0000000000..f1e889e8e3 --- /dev/null +++ b/collector/fixtures/proc/10/net @@ -0,0 +1 @@ +../net \ No newline at end of file diff --git a/collector/netstat_descs_drift_test.go b/collector/netstat_descs_drift_test.go new file mode 100644 index 0000000000..8be8ee72b7 --- /dev/null +++ b/collector/netstat_descs_drift_test.go @@ -0,0 +1,78 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package collector + +import ( + "os" + "reflect" + "regexp" + "sort" + "testing" + + "github.com/prometheus/procfs" +) + +// TestNetStatDescsInSync guards against drift between the committed descriptor +// table (netstat_descs_linux.go) and the procfs structs it is generated from. +// If a procfs upgrade adds or removes statistics fields, this test fails until +// the table is regenerated with `GOOS=linux go generate ./collector`. +func TestNetStatDescsInSync(t *testing.T) { + src, err := os.ReadFile("netstat_descs_linux.go") + if err != nil { + t.Fatalf("read netstat_descs_linux.go: %v", err) + } + + re := regexp.MustCompile(`"([A-Za-z0-9]+_[A-Za-z0-9]+)": prometheus\.NewDesc`) + committed := map[string]bool{} + for _, m := range re.FindAllSubmatch(src, -1) { + committed[string(m[1])] = true + } + + var n procfs.ProcNetstat + var s procfs.ProcSnmp + var s6 procfs.ProcSnmp6 + expected := map[string]bool{} + for _, v := range []any{ + n.TcpExt, n.IpExt, + s.Ip, s.Icmp, s.IcmpMsg, s.Tcp, s.Udp, s.UdpLite, + s6.Ip6, s6.Icmp6, s6.Udp6, s6.UdpLite6, + } { + tt := reflect.TypeOf(v) + for i := 0; i < tt.NumField(); i++ { + f := tt.Field(i) + if f.Type != reflect.TypeFor[*float64]() { + continue + } + expected[tt.Name()+"_"+f.Name] = true + } + } + + var missing, extra []string + for k := range expected { + if !committed[k] { + missing = append(missing, k) + } + } + for k := range committed { + if !expected[k] { + extra = append(extra, k) + } + } + sort.Strings(missing) + sort.Strings(extra) + + if len(missing) != 0 || len(extra) != 0 { + t.Fatalf("netstat_descs_linux.go is out of sync with procfs (missing=%v extra=%v); run `GOOS=linux go generate ./collector`", missing, extra) + } +} diff --git a/collector/netstat_descs_gen.go b/collector/netstat_descs_gen.go new file mode 100644 index 0000000000..3027a82aa5 --- /dev/null +++ b/collector/netstat_descs_gen.go @@ -0,0 +1,96 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build ignore + +// Command netstat-descs regenerates collector/netstat_descs_linux.go from the +// procfs netstat/snmp/snmp6 statistics structs. +// +// Run from the repository root: +// +// go generate ./collector +// +// The output is a table of explicit, source-visible prometheus.Desc literals +// (one per *float64 field of each statistics struct), keyed by +// "_". Keeping the descriptors as literals lets the AST-based +// documentation tooling read them and avoids allocating descriptors per scrape. +package main + +import ( + "fmt" + "os" + "reflect" + "strings" + + "github.com/prometheus/procfs" +) + +type entry struct { + key string + help string +} + +func main() { + var n procfs.ProcNetstat + var s procfs.ProcSnmp + var s6 procfs.ProcSnmp6 + + structs := []any{ + n.TcpExt, n.IpExt, + s.Ip, s.Icmp, s.IcmpMsg, s.Tcp, s.Udp, s.UdpLite, + s6.Ip6, s6.Icmp6, s6.Udp6, s6.UdpLite6, + } + + var b strings.Builder + b.WriteString(`// Code generated by netstat-descs; DO NOT EDIT. + +//go:build !nonetstat + +package collector + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// netStatMetricDescs returns the explicit, source-visible metric descriptors +// for every field of the procfs netstat/snmp/snmp6 statistics structs, keyed by +// "_". Descriptors are allocated once; collection looks them up +// by name instead of calling prometheus.NewDesc on every scrape. +func netStatMetricDescs() map[string]*prometheus.Desc { + return map[string]*prometheus.Desc{ +`) + + count := 0 + for _, v := range structs { + t := reflect.TypeOf(v) + proto := t.Name() + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if f.Type != reflect.TypeFor[*float64]() { + continue + } + key := proto + "_" + f.Name + help := "Statistic " + proto + f.Name + "." + fmt.Fprintf(&b, "\t\t%q: prometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, netStatsSubsystem, %q),\n\t\t\t%q,\n\t\t\tnil, nil),\n", key, key, help) + count++ + } + } + + b.WriteString("\t}\n}\n") + + if err := os.WriteFile("netstat_descs_linux.go", []byte(b.String()), 0o644); err != nil { + fmt.Fprintln(os.Stderr, "write netstat_descs_linux.go:", err) + os.Exit(1) + } + fmt.Fprintf(os.Stderr, "wrote netstat_descs_linux.go (%d descriptors)\n", count) +} diff --git a/collector/netstat_descs_linux.go b/collector/netstat_descs_linux.go new file mode 100644 index 0000000000..1abc6ebec1 --- /dev/null +++ b/collector/netstat_descs_linux.go @@ -0,0 +1,1262 @@ +// Code generated by netstat-descs; DO NOT EDIT. + +//go:build !nonetstat + +package collector + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// netStatMetricDescs returns the explicit, source-visible metric descriptors +// for every field of the procfs netstat/snmp/snmp6 statistics structs, keyed by +// "_". Descriptors are allocated once; collection looks them up +// by name instead of calling prometheus.NewDesc on every scrape. +func netStatMetricDescs() map[string]*prometheus.Desc { + return map[string]*prometheus.Desc{ + "TcpExt_SyncookiesSent": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_SyncookiesSent"), + "Statistic TcpExtSyncookiesSent.", + nil, nil), + "TcpExt_SyncookiesRecv": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_SyncookiesRecv"), + "Statistic TcpExtSyncookiesRecv.", + nil, nil), + "TcpExt_SyncookiesFailed": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_SyncookiesFailed"), + "Statistic TcpExtSyncookiesFailed.", + nil, nil), + "TcpExt_EmbryonicRsts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_EmbryonicRsts"), + "Statistic TcpExtEmbryonicRsts.", + nil, nil), + "TcpExt_PruneCalled": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_PruneCalled"), + "Statistic TcpExtPruneCalled.", + nil, nil), + "TcpExt_RcvPruned": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_RcvPruned"), + "Statistic TcpExtRcvPruned.", + nil, nil), + "TcpExt_OfoPruned": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_OfoPruned"), + "Statistic TcpExtOfoPruned.", + nil, nil), + "TcpExt_OutOfWindowIcmps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_OutOfWindowIcmps"), + "Statistic TcpExtOutOfWindowIcmps.", + nil, nil), + "TcpExt_LockDroppedIcmps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_LockDroppedIcmps"), + "Statistic TcpExtLockDroppedIcmps.", + nil, nil), + "TcpExt_ArpFilter": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_ArpFilter"), + "Statistic TcpExtArpFilter.", + nil, nil), + "TcpExt_TW": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TW"), + "Statistic TcpExtTW.", + nil, nil), + "TcpExt_TWRecycled": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TWRecycled"), + "Statistic TcpExtTWRecycled.", + nil, nil), + "TcpExt_TWKilled": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TWKilled"), + "Statistic TcpExtTWKilled.", + nil, nil), + "TcpExt_PAWSActive": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_PAWSActive"), + "Statistic TcpExtPAWSActive.", + nil, nil), + "TcpExt_PAWSEstab": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_PAWSEstab"), + "Statistic TcpExtPAWSEstab.", + nil, nil), + "TcpExt_DelayedACKs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_DelayedACKs"), + "Statistic TcpExtDelayedACKs.", + nil, nil), + "TcpExt_DelayedACKLocked": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_DelayedACKLocked"), + "Statistic TcpExtDelayedACKLocked.", + nil, nil), + "TcpExt_DelayedACKLost": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_DelayedACKLost"), + "Statistic TcpExtDelayedACKLost.", + nil, nil), + "TcpExt_ListenOverflows": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_ListenOverflows"), + "Statistic TcpExtListenOverflows.", + nil, nil), + "TcpExt_ListenDrops": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_ListenDrops"), + "Statistic TcpExtListenDrops.", + nil, nil), + "TcpExt_TCPHPHits": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPHPHits"), + "Statistic TcpExtTCPHPHits.", + nil, nil), + "TcpExt_TCPPureAcks": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPPureAcks"), + "Statistic TcpExtTCPPureAcks.", + nil, nil), + "TcpExt_TCPHPAcks": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPHPAcks"), + "Statistic TcpExtTCPHPAcks.", + nil, nil), + "TcpExt_TCPRenoRecovery": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRenoRecovery"), + "Statistic TcpExtTCPRenoRecovery.", + nil, nil), + "TcpExt_TCPSackRecovery": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSackRecovery"), + "Statistic TcpExtTCPSackRecovery.", + nil, nil), + "TcpExt_TCPSACKReneging": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSACKReneging"), + "Statistic TcpExtTCPSACKReneging.", + nil, nil), + "TcpExt_TCPSACKReorder": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSACKReorder"), + "Statistic TcpExtTCPSACKReorder.", + nil, nil), + "TcpExt_TCPRenoReorder": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRenoReorder"), + "Statistic TcpExtTCPRenoReorder.", + nil, nil), + "TcpExt_TCPTSReorder": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPTSReorder"), + "Statistic TcpExtTCPTSReorder.", + nil, nil), + "TcpExt_TCPFullUndo": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFullUndo"), + "Statistic TcpExtTCPFullUndo.", + nil, nil), + "TcpExt_TCPPartialUndo": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPPartialUndo"), + "Statistic TcpExtTCPPartialUndo.", + nil, nil), + "TcpExt_TCPDSACKUndo": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDSACKUndo"), + "Statistic TcpExtTCPDSACKUndo.", + nil, nil), + "TcpExt_TCPLossUndo": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPLossUndo"), + "Statistic TcpExtTCPLossUndo.", + nil, nil), + "TcpExt_TCPLostRetransmit": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPLostRetransmit"), + "Statistic TcpExtTCPLostRetransmit.", + nil, nil), + "TcpExt_TCPRenoFailures": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRenoFailures"), + "Statistic TcpExtTCPRenoFailures.", + nil, nil), + "TcpExt_TCPSackFailures": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSackFailures"), + "Statistic TcpExtTCPSackFailures.", + nil, nil), + "TcpExt_TCPLossFailures": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPLossFailures"), + "Statistic TcpExtTCPLossFailures.", + nil, nil), + "TcpExt_TCPFastRetrans": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastRetrans"), + "Statistic TcpExtTCPFastRetrans.", + nil, nil), + "TcpExt_TCPSlowStartRetrans": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSlowStartRetrans"), + "Statistic TcpExtTCPSlowStartRetrans.", + nil, nil), + "TcpExt_TCPTimeouts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPTimeouts"), + "Statistic TcpExtTCPTimeouts.", + nil, nil), + "TcpExt_TCPLossProbes": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPLossProbes"), + "Statistic TcpExtTCPLossProbes.", + nil, nil), + "TcpExt_TCPLossProbeRecovery": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPLossProbeRecovery"), + "Statistic TcpExtTCPLossProbeRecovery.", + nil, nil), + "TcpExt_TCPRenoRecoveryFail": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRenoRecoveryFail"), + "Statistic TcpExtTCPRenoRecoveryFail.", + nil, nil), + "TcpExt_TCPSackRecoveryFail": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSackRecoveryFail"), + "Statistic TcpExtTCPSackRecoveryFail.", + nil, nil), + "TcpExt_TCPRcvCollapsed": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRcvCollapsed"), + "Statistic TcpExtTCPRcvCollapsed.", + nil, nil), + "TcpExt_TCPDSACKOldSent": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDSACKOldSent"), + "Statistic TcpExtTCPDSACKOldSent.", + nil, nil), + "TcpExt_TCPDSACKOfoSent": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDSACKOfoSent"), + "Statistic TcpExtTCPDSACKOfoSent.", + nil, nil), + "TcpExt_TCPDSACKRecv": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDSACKRecv"), + "Statistic TcpExtTCPDSACKRecv.", + nil, nil), + "TcpExt_TCPDSACKOfoRecv": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDSACKOfoRecv"), + "Statistic TcpExtTCPDSACKOfoRecv.", + nil, nil), + "TcpExt_TCPAbortOnData": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPAbortOnData"), + "Statistic TcpExtTCPAbortOnData.", + nil, nil), + "TcpExt_TCPAbortOnClose": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPAbortOnClose"), + "Statistic TcpExtTCPAbortOnClose.", + nil, nil), + "TcpExt_TCPAbortOnMemory": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPAbortOnMemory"), + "Statistic TcpExtTCPAbortOnMemory.", + nil, nil), + "TcpExt_TCPAbortOnTimeout": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPAbortOnTimeout"), + "Statistic TcpExtTCPAbortOnTimeout.", + nil, nil), + "TcpExt_TCPAbortOnLinger": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPAbortOnLinger"), + "Statistic TcpExtTCPAbortOnLinger.", + nil, nil), + "TcpExt_TCPAbortFailed": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPAbortFailed"), + "Statistic TcpExtTCPAbortFailed.", + nil, nil), + "TcpExt_TCPMemoryPressures": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMemoryPressures"), + "Statistic TcpExtTCPMemoryPressures.", + nil, nil), + "TcpExt_TCPMemoryPressuresChrono": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMemoryPressuresChrono"), + "Statistic TcpExtTCPMemoryPressuresChrono.", + nil, nil), + "TcpExt_TCPSACKDiscard": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSACKDiscard"), + "Statistic TcpExtTCPSACKDiscard.", + nil, nil), + "TcpExt_TCPDSACKIgnoredOld": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDSACKIgnoredOld"), + "Statistic TcpExtTCPDSACKIgnoredOld.", + nil, nil), + "TcpExt_TCPDSACKIgnoredNoUndo": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDSACKIgnoredNoUndo"), + "Statistic TcpExtTCPDSACKIgnoredNoUndo.", + nil, nil), + "TcpExt_TCPSpuriousRTOs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSpuriousRTOs"), + "Statistic TcpExtTCPSpuriousRTOs.", + nil, nil), + "TcpExt_TCPMD5NotFound": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMD5NotFound"), + "Statistic TcpExtTCPMD5NotFound.", + nil, nil), + "TcpExt_TCPMD5Unexpected": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMD5Unexpected"), + "Statistic TcpExtTCPMD5Unexpected.", + nil, nil), + "TcpExt_TCPMD5Failure": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMD5Failure"), + "Statistic TcpExtTCPMD5Failure.", + nil, nil), + "TcpExt_TCPSackShifted": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSackShifted"), + "Statistic TcpExtTCPSackShifted.", + nil, nil), + "TcpExt_TCPSackMerged": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSackMerged"), + "Statistic TcpExtTCPSackMerged.", + nil, nil), + "TcpExt_TCPSackShiftFallback": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSackShiftFallback"), + "Statistic TcpExtTCPSackShiftFallback.", + nil, nil), + "TcpExt_TCPBacklogDrop": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPBacklogDrop"), + "Statistic TcpExtTCPBacklogDrop.", + nil, nil), + "TcpExt_PFMemallocDrop": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_PFMemallocDrop"), + "Statistic TcpExtPFMemallocDrop.", + nil, nil), + "TcpExt_TCPMinTTLDrop": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMinTTLDrop"), + "Statistic TcpExtTCPMinTTLDrop.", + nil, nil), + "TcpExt_TCPDeferAcceptDrop": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDeferAcceptDrop"), + "Statistic TcpExtTCPDeferAcceptDrop.", + nil, nil), + "TcpExt_IPReversePathFilter": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_IPReversePathFilter"), + "Statistic TcpExtIPReversePathFilter.", + nil, nil), + "TcpExt_TCPTimeWaitOverflow": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPTimeWaitOverflow"), + "Statistic TcpExtTCPTimeWaitOverflow.", + nil, nil), + "TcpExt_TCPReqQFullDoCookies": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPReqQFullDoCookies"), + "Statistic TcpExtTCPReqQFullDoCookies.", + nil, nil), + "TcpExt_TCPReqQFullDrop": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPReqQFullDrop"), + "Statistic TcpExtTCPReqQFullDrop.", + nil, nil), + "TcpExt_TCPRetransFail": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRetransFail"), + "Statistic TcpExtTCPRetransFail.", + nil, nil), + "TcpExt_TCPRcvCoalesce": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRcvCoalesce"), + "Statistic TcpExtTCPRcvCoalesce.", + nil, nil), + "TcpExt_TCPRcvQDrop": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPRcvQDrop"), + "Statistic TcpExtTCPRcvQDrop.", + nil, nil), + "TcpExt_TCPOFOQueue": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPOFOQueue"), + "Statistic TcpExtTCPOFOQueue.", + nil, nil), + "TcpExt_TCPOFODrop": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPOFODrop"), + "Statistic TcpExtTCPOFODrop.", + nil, nil), + "TcpExt_TCPOFOMerge": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPOFOMerge"), + "Statistic TcpExtTCPOFOMerge.", + nil, nil), + "TcpExt_TCPChallengeACK": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPChallengeACK"), + "Statistic TcpExtTCPChallengeACK.", + nil, nil), + "TcpExt_TCPSYNChallenge": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSYNChallenge"), + "Statistic TcpExtTCPSYNChallenge.", + nil, nil), + "TcpExt_TCPFastOpenActive": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastOpenActive"), + "Statistic TcpExtTCPFastOpenActive.", + nil, nil), + "TcpExt_TCPFastOpenActiveFail": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastOpenActiveFail"), + "Statistic TcpExtTCPFastOpenActiveFail.", + nil, nil), + "TcpExt_TCPFastOpenPassive": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastOpenPassive"), + "Statistic TcpExtTCPFastOpenPassive.", + nil, nil), + "TcpExt_TCPFastOpenPassiveFail": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastOpenPassiveFail"), + "Statistic TcpExtTCPFastOpenPassiveFail.", + nil, nil), + "TcpExt_TCPFastOpenListenOverflow": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastOpenListenOverflow"), + "Statistic TcpExtTCPFastOpenListenOverflow.", + nil, nil), + "TcpExt_TCPFastOpenCookieReqd": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastOpenCookieReqd"), + "Statistic TcpExtTCPFastOpenCookieReqd.", + nil, nil), + "TcpExt_TCPFastOpenBlackhole": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFastOpenBlackhole"), + "Statistic TcpExtTCPFastOpenBlackhole.", + nil, nil), + "TcpExt_TCPSpuriousRtxHostQueues": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSpuriousRtxHostQueues"), + "Statistic TcpExtTCPSpuriousRtxHostQueues.", + nil, nil), + "TcpExt_BusyPollRxPackets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_BusyPollRxPackets"), + "Statistic TcpExtBusyPollRxPackets.", + nil, nil), + "TcpExt_TCPAutoCorking": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPAutoCorking"), + "Statistic TcpExtTCPAutoCorking.", + nil, nil), + "TcpExt_TCPFromZeroWindowAdv": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFromZeroWindowAdv"), + "Statistic TcpExtTCPFromZeroWindowAdv.", + nil, nil), + "TcpExt_TCPToZeroWindowAdv": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPToZeroWindowAdv"), + "Statistic TcpExtTCPToZeroWindowAdv.", + nil, nil), + "TcpExt_TCPWantZeroWindowAdv": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPWantZeroWindowAdv"), + "Statistic TcpExtTCPWantZeroWindowAdv.", + nil, nil), + "TcpExt_TCPSynRetrans": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSynRetrans"), + "Statistic TcpExtTCPSynRetrans.", + nil, nil), + "TcpExt_TCPOrigDataSent": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPOrigDataSent"), + "Statistic TcpExtTCPOrigDataSent.", + nil, nil), + "TcpExt_TCPHystartTrainDetect": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPHystartTrainDetect"), + "Statistic TcpExtTCPHystartTrainDetect.", + nil, nil), + "TcpExt_TCPHystartTrainCwnd": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPHystartTrainCwnd"), + "Statistic TcpExtTCPHystartTrainCwnd.", + nil, nil), + "TcpExt_TCPHystartDelayDetect": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPHystartDelayDetect"), + "Statistic TcpExtTCPHystartDelayDetect.", + nil, nil), + "TcpExt_TCPHystartDelayCwnd": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPHystartDelayCwnd"), + "Statistic TcpExtTCPHystartDelayCwnd.", + nil, nil), + "TcpExt_TCPACKSkippedSynRecv": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPACKSkippedSynRecv"), + "Statistic TcpExtTCPACKSkippedSynRecv.", + nil, nil), + "TcpExt_TCPACKSkippedPAWS": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPACKSkippedPAWS"), + "Statistic TcpExtTCPACKSkippedPAWS.", + nil, nil), + "TcpExt_TCPACKSkippedSeq": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPACKSkippedSeq"), + "Statistic TcpExtTCPACKSkippedSeq.", + nil, nil), + "TcpExt_TCPACKSkippedFinWait2": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPACKSkippedFinWait2"), + "Statistic TcpExtTCPACKSkippedFinWait2.", + nil, nil), + "TcpExt_TCPACKSkippedTimeWait": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPACKSkippedTimeWait"), + "Statistic TcpExtTCPACKSkippedTimeWait.", + nil, nil), + "TcpExt_TCPACKSkippedChallenge": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPACKSkippedChallenge"), + "Statistic TcpExtTCPACKSkippedChallenge.", + nil, nil), + "TcpExt_TCPWinProbe": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPWinProbe"), + "Statistic TcpExtTCPWinProbe.", + nil, nil), + "TcpExt_TCPKeepAlive": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPKeepAlive"), + "Statistic TcpExtTCPKeepAlive.", + nil, nil), + "TcpExt_TCPMTUPFail": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMTUPFail"), + "Statistic TcpExtTCPMTUPFail.", + nil, nil), + "TcpExt_TCPMTUPSuccess": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPMTUPSuccess"), + "Statistic TcpExtTCPMTUPSuccess.", + nil, nil), + "TcpExt_TCPWqueueTooBig": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPWqueueTooBig"), + "Statistic TcpExtTCPWqueueTooBig.", + nil, nil), + "TcpExt_TCPLoss": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPLoss"), + "Statistic TcpExtTCPLoss.", + nil, nil), + "TcpExt_PAWSPassive": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_PAWSPassive"), + "Statistic TcpExtPAWSPassive.", + nil, nil), + "TcpExt_TCPForwardRetrans": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPForwardRetrans"), + "Statistic TcpExtTCPForwardRetrans.", + nil, nil), + "TcpExt_TCPSchedulerFailed": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPSchedulerFailed"), + "Statistic TcpExtTCPSchedulerFailed.", + nil, nil), + "TcpExt_TCPPrequeued": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPPrequeued"), + "Statistic TcpExtTCPPrequeued.", + nil, nil), + "TcpExt_TCPDirectCopyFromBacklog": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDirectCopyFromBacklog"), + "Statistic TcpExtTCPDirectCopyFromBacklog.", + nil, nil), + "TcpExt_TCPDirectCopyFromPrequeue": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPDirectCopyFromPrequeue"), + "Statistic TcpExtTCPDirectCopyFromPrequeue.", + nil, nil), + "TcpExt_TCPPrequeueDropped": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPPrequeueDropped"), + "Statistic TcpExtTCPPrequeueDropped.", + nil, nil), + "TcpExt_TCPFACKReorder": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPFACKReorder"), + "Statistic TcpExtTCPFACKReorder.", + nil, nil), + "TcpExt_TCPHPHitsToUser": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "TcpExt_TCPHPHitsToUser"), + "Statistic TcpExtTCPHPHitsToUser.", + nil, nil), + "IpExt_InNoRoutes": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InNoRoutes"), + "Statistic IpExtInNoRoutes.", + nil, nil), + "IpExt_InTruncatedPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InTruncatedPkts"), + "Statistic IpExtInTruncatedPkts.", + nil, nil), + "IpExt_InMcastPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InMcastPkts"), + "Statistic IpExtInMcastPkts.", + nil, nil), + "IpExt_OutMcastPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_OutMcastPkts"), + "Statistic IpExtOutMcastPkts.", + nil, nil), + "IpExt_InBcastPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InBcastPkts"), + "Statistic IpExtInBcastPkts.", + nil, nil), + "IpExt_OutBcastPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_OutBcastPkts"), + "Statistic IpExtOutBcastPkts.", + nil, nil), + "IpExt_InOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InOctets"), + "Statistic IpExtInOctets.", + nil, nil), + "IpExt_OutOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_OutOctets"), + "Statistic IpExtOutOctets.", + nil, nil), + "IpExt_InMcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InMcastOctets"), + "Statistic IpExtInMcastOctets.", + nil, nil), + "IpExt_OutMcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_OutMcastOctets"), + "Statistic IpExtOutMcastOctets.", + nil, nil), + "IpExt_InBcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InBcastOctets"), + "Statistic IpExtInBcastOctets.", + nil, nil), + "IpExt_OutBcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_OutBcastOctets"), + "Statistic IpExtOutBcastOctets.", + nil, nil), + "IpExt_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InCsumErrors"), + "Statistic IpExtInCsumErrors.", + nil, nil), + "IpExt_InNoECTPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InNoECTPkts"), + "Statistic IpExtInNoECTPkts.", + nil, nil), + "IpExt_InECT1Pkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InECT1Pkts"), + "Statistic IpExtInECT1Pkts.", + nil, nil), + "IpExt_InECT0Pkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InECT0Pkts"), + "Statistic IpExtInECT0Pkts.", + nil, nil), + "IpExt_InCEPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_InCEPkts"), + "Statistic IpExtInCEPkts.", + nil, nil), + "IpExt_ReasmOverlaps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IpExt_ReasmOverlaps"), + "Statistic IpExtReasmOverlaps.", + nil, nil), + "Ip_Forwarding": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_Forwarding"), + "Statistic IpForwarding.", + nil, nil), + "Ip_DefaultTTL": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_DefaultTTL"), + "Statistic IpDefaultTTL.", + nil, nil), + "Ip_InReceives": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_InReceives"), + "Statistic IpInReceives.", + nil, nil), + "Ip_InHdrErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_InHdrErrors"), + "Statistic IpInHdrErrors.", + nil, nil), + "Ip_InAddrErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_InAddrErrors"), + "Statistic IpInAddrErrors.", + nil, nil), + "Ip_ForwDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_ForwDatagrams"), + "Statistic IpForwDatagrams.", + nil, nil), + "Ip_InUnknownProtos": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_InUnknownProtos"), + "Statistic IpInUnknownProtos.", + nil, nil), + "Ip_InDiscards": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_InDiscards"), + "Statistic IpInDiscards.", + nil, nil), + "Ip_InDelivers": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_InDelivers"), + "Statistic IpInDelivers.", + nil, nil), + "Ip_OutRequests": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_OutRequests"), + "Statistic IpOutRequests.", + nil, nil), + "Ip_OutDiscards": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_OutDiscards"), + "Statistic IpOutDiscards.", + nil, nil), + "Ip_OutNoRoutes": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_OutNoRoutes"), + "Statistic IpOutNoRoutes.", + nil, nil), + "Ip_ReasmTimeout": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_ReasmTimeout"), + "Statistic IpReasmTimeout.", + nil, nil), + "Ip_ReasmReqds": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_ReasmReqds"), + "Statistic IpReasmReqds.", + nil, nil), + "Ip_ReasmOKs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_ReasmOKs"), + "Statistic IpReasmOKs.", + nil, nil), + "Ip_ReasmFails": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_ReasmFails"), + "Statistic IpReasmFails.", + nil, nil), + "Ip_FragOKs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_FragOKs"), + "Statistic IpFragOKs.", + nil, nil), + "Ip_FragFails": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_FragFails"), + "Statistic IpFragFails.", + nil, nil), + "Ip_FragCreates": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip_FragCreates"), + "Statistic IpFragCreates.", + nil, nil), + "Icmp_InMsgs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InMsgs"), + "Statistic IcmpInMsgs.", + nil, nil), + "Icmp_InErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InErrors"), + "Statistic IcmpInErrors.", + nil, nil), + "Icmp_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InCsumErrors"), + "Statistic IcmpInCsumErrors.", + nil, nil), + "Icmp_InDestUnreachs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InDestUnreachs"), + "Statistic IcmpInDestUnreachs.", + nil, nil), + "Icmp_InTimeExcds": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InTimeExcds"), + "Statistic IcmpInTimeExcds.", + nil, nil), + "Icmp_InParmProbs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InParmProbs"), + "Statistic IcmpInParmProbs.", + nil, nil), + "Icmp_InSrcQuenchs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InSrcQuenchs"), + "Statistic IcmpInSrcQuenchs.", + nil, nil), + "Icmp_InRedirects": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InRedirects"), + "Statistic IcmpInRedirects.", + nil, nil), + "Icmp_InEchos": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InEchos"), + "Statistic IcmpInEchos.", + nil, nil), + "Icmp_InEchoReps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InEchoReps"), + "Statistic IcmpInEchoReps.", + nil, nil), + "Icmp_InTimestamps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InTimestamps"), + "Statistic IcmpInTimestamps.", + nil, nil), + "Icmp_InTimestampReps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InTimestampReps"), + "Statistic IcmpInTimestampReps.", + nil, nil), + "Icmp_InAddrMasks": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InAddrMasks"), + "Statistic IcmpInAddrMasks.", + nil, nil), + "Icmp_InAddrMaskReps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_InAddrMaskReps"), + "Statistic IcmpInAddrMaskReps.", + nil, nil), + "Icmp_OutMsgs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutMsgs"), + "Statistic IcmpOutMsgs.", + nil, nil), + "Icmp_OutErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutErrors"), + "Statistic IcmpOutErrors.", + nil, nil), + "Icmp_OutDestUnreachs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutDestUnreachs"), + "Statistic IcmpOutDestUnreachs.", + nil, nil), + "Icmp_OutTimeExcds": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutTimeExcds"), + "Statistic IcmpOutTimeExcds.", + nil, nil), + "Icmp_OutParmProbs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutParmProbs"), + "Statistic IcmpOutParmProbs.", + nil, nil), + "Icmp_OutSrcQuenchs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutSrcQuenchs"), + "Statistic IcmpOutSrcQuenchs.", + nil, nil), + "Icmp_OutRedirects": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutRedirects"), + "Statistic IcmpOutRedirects.", + nil, nil), + "Icmp_OutEchos": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutEchos"), + "Statistic IcmpOutEchos.", + nil, nil), + "Icmp_OutEchoReps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutEchoReps"), + "Statistic IcmpOutEchoReps.", + nil, nil), + "Icmp_OutTimestamps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutTimestamps"), + "Statistic IcmpOutTimestamps.", + nil, nil), + "Icmp_OutTimestampReps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutTimestampReps"), + "Statistic IcmpOutTimestampReps.", + nil, nil), + "Icmp_OutAddrMasks": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutAddrMasks"), + "Statistic IcmpOutAddrMasks.", + nil, nil), + "Icmp_OutAddrMaskReps": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp_OutAddrMaskReps"), + "Statistic IcmpOutAddrMaskReps.", + nil, nil), + "IcmpMsg_InType3": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IcmpMsg_InType3"), + "Statistic IcmpMsgInType3.", + nil, nil), + "IcmpMsg_OutType3": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "IcmpMsg_OutType3"), + "Statistic IcmpMsgOutType3.", + nil, nil), + "Tcp_RtoAlgorithm": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_RtoAlgorithm"), + "Statistic TcpRtoAlgorithm.", + nil, nil), + "Tcp_RtoMin": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_RtoMin"), + "Statistic TcpRtoMin.", + nil, nil), + "Tcp_RtoMax": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_RtoMax"), + "Statistic TcpRtoMax.", + nil, nil), + "Tcp_MaxConn": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_MaxConn"), + "Statistic TcpMaxConn.", + nil, nil), + "Tcp_ActiveOpens": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_ActiveOpens"), + "Statistic TcpActiveOpens.", + nil, nil), + "Tcp_PassiveOpens": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_PassiveOpens"), + "Statistic TcpPassiveOpens.", + nil, nil), + "Tcp_AttemptFails": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_AttemptFails"), + "Statistic TcpAttemptFails.", + nil, nil), + "Tcp_EstabResets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_EstabResets"), + "Statistic TcpEstabResets.", + nil, nil), + "Tcp_CurrEstab": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_CurrEstab"), + "Statistic TcpCurrEstab.", + nil, nil), + "Tcp_InSegs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_InSegs"), + "Statistic TcpInSegs.", + nil, nil), + "Tcp_OutSegs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_OutSegs"), + "Statistic TcpOutSegs.", + nil, nil), + "Tcp_RetransSegs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_RetransSegs"), + "Statistic TcpRetransSegs.", + nil, nil), + "Tcp_InErrs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_InErrs"), + "Statistic TcpInErrs.", + nil, nil), + "Tcp_OutRsts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_OutRsts"), + "Statistic TcpOutRsts.", + nil, nil), + "Tcp_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Tcp_InCsumErrors"), + "Statistic TcpInCsumErrors.", + nil, nil), + "Udp_InDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_InDatagrams"), + "Statistic UdpInDatagrams.", + nil, nil), + "Udp_NoPorts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_NoPorts"), + "Statistic UdpNoPorts.", + nil, nil), + "Udp_InErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_InErrors"), + "Statistic UdpInErrors.", + nil, nil), + "Udp_OutDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_OutDatagrams"), + "Statistic UdpOutDatagrams.", + nil, nil), + "Udp_RcvbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_RcvbufErrors"), + "Statistic UdpRcvbufErrors.", + nil, nil), + "Udp_SndbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_SndbufErrors"), + "Statistic UdpSndbufErrors.", + nil, nil), + "Udp_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_InCsumErrors"), + "Statistic UdpInCsumErrors.", + nil, nil), + "Udp_IgnoredMulti": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp_IgnoredMulti"), + "Statistic UdpIgnoredMulti.", + nil, nil), + "UdpLite_InDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_InDatagrams"), + "Statistic UdpLiteInDatagrams.", + nil, nil), + "UdpLite_NoPorts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_NoPorts"), + "Statistic UdpLiteNoPorts.", + nil, nil), + "UdpLite_InErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_InErrors"), + "Statistic UdpLiteInErrors.", + nil, nil), + "UdpLite_OutDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_OutDatagrams"), + "Statistic UdpLiteOutDatagrams.", + nil, nil), + "UdpLite_RcvbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_RcvbufErrors"), + "Statistic UdpLiteRcvbufErrors.", + nil, nil), + "UdpLite_SndbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_SndbufErrors"), + "Statistic UdpLiteSndbufErrors.", + nil, nil), + "UdpLite_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_InCsumErrors"), + "Statistic UdpLiteInCsumErrors.", + nil, nil), + "UdpLite_IgnoredMulti": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite_IgnoredMulti"), + "Statistic UdpLiteIgnoredMulti.", + nil, nil), + "Ip6_InReceives": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InReceives"), + "Statistic Ip6InReceives.", + nil, nil), + "Ip6_InHdrErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InHdrErrors"), + "Statistic Ip6InHdrErrors.", + nil, nil), + "Ip6_InTooBigErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InTooBigErrors"), + "Statistic Ip6InTooBigErrors.", + nil, nil), + "Ip6_InNoRoutes": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InNoRoutes"), + "Statistic Ip6InNoRoutes.", + nil, nil), + "Ip6_InAddrErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InAddrErrors"), + "Statistic Ip6InAddrErrors.", + nil, nil), + "Ip6_InUnknownProtos": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InUnknownProtos"), + "Statistic Ip6InUnknownProtos.", + nil, nil), + "Ip6_InTruncatedPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InTruncatedPkts"), + "Statistic Ip6InTruncatedPkts.", + nil, nil), + "Ip6_InDiscards": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InDiscards"), + "Statistic Ip6InDiscards.", + nil, nil), + "Ip6_InDelivers": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InDelivers"), + "Statistic Ip6InDelivers.", + nil, nil), + "Ip6_OutForwDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutForwDatagrams"), + "Statistic Ip6OutForwDatagrams.", + nil, nil), + "Ip6_OutRequests": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutRequests"), + "Statistic Ip6OutRequests.", + nil, nil), + "Ip6_OutDiscards": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutDiscards"), + "Statistic Ip6OutDiscards.", + nil, nil), + "Ip6_OutNoRoutes": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutNoRoutes"), + "Statistic Ip6OutNoRoutes.", + nil, nil), + "Ip6_ReasmTimeout": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_ReasmTimeout"), + "Statistic Ip6ReasmTimeout.", + nil, nil), + "Ip6_ReasmReqds": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_ReasmReqds"), + "Statistic Ip6ReasmReqds.", + nil, nil), + "Ip6_ReasmOKs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_ReasmOKs"), + "Statistic Ip6ReasmOKs.", + nil, nil), + "Ip6_ReasmFails": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_ReasmFails"), + "Statistic Ip6ReasmFails.", + nil, nil), + "Ip6_FragOKs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_FragOKs"), + "Statistic Ip6FragOKs.", + nil, nil), + "Ip6_FragFails": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_FragFails"), + "Statistic Ip6FragFails.", + nil, nil), + "Ip6_FragCreates": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_FragCreates"), + "Statistic Ip6FragCreates.", + nil, nil), + "Ip6_InMcastPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InMcastPkts"), + "Statistic Ip6InMcastPkts.", + nil, nil), + "Ip6_OutMcastPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutMcastPkts"), + "Statistic Ip6OutMcastPkts.", + nil, nil), + "Ip6_InOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InOctets"), + "Statistic Ip6InOctets.", + nil, nil), + "Ip6_OutOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutOctets"), + "Statistic Ip6OutOctets.", + nil, nil), + "Ip6_InMcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InMcastOctets"), + "Statistic Ip6InMcastOctets.", + nil, nil), + "Ip6_OutMcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutMcastOctets"), + "Statistic Ip6OutMcastOctets.", + nil, nil), + "Ip6_InBcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InBcastOctets"), + "Statistic Ip6InBcastOctets.", + nil, nil), + "Ip6_OutBcastOctets": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_OutBcastOctets"), + "Statistic Ip6OutBcastOctets.", + nil, nil), + "Ip6_InNoECTPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InNoECTPkts"), + "Statistic Ip6InNoECTPkts.", + nil, nil), + "Ip6_InECT1Pkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InECT1Pkts"), + "Statistic Ip6InECT1Pkts.", + nil, nil), + "Ip6_InECT0Pkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InECT0Pkts"), + "Statistic Ip6InECT0Pkts.", + nil, nil), + "Ip6_InCEPkts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Ip6_InCEPkts"), + "Statistic Ip6InCEPkts.", + nil, nil), + "Icmp6_InMsgs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InMsgs"), + "Statistic Icmp6InMsgs.", + nil, nil), + "Icmp6_InErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InErrors"), + "Statistic Icmp6InErrors.", + nil, nil), + "Icmp6_OutMsgs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutMsgs"), + "Statistic Icmp6OutMsgs.", + nil, nil), + "Icmp6_OutErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutErrors"), + "Statistic Icmp6OutErrors.", + nil, nil), + "Icmp6_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InCsumErrors"), + "Statistic Icmp6InCsumErrors.", + nil, nil), + "Icmp6_InDestUnreachs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InDestUnreachs"), + "Statistic Icmp6InDestUnreachs.", + nil, nil), + "Icmp6_InPktTooBigs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InPktTooBigs"), + "Statistic Icmp6InPktTooBigs.", + nil, nil), + "Icmp6_InTimeExcds": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InTimeExcds"), + "Statistic Icmp6InTimeExcds.", + nil, nil), + "Icmp6_InParmProblems": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InParmProblems"), + "Statistic Icmp6InParmProblems.", + nil, nil), + "Icmp6_InEchos": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InEchos"), + "Statistic Icmp6InEchos.", + nil, nil), + "Icmp6_InEchoReplies": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InEchoReplies"), + "Statistic Icmp6InEchoReplies.", + nil, nil), + "Icmp6_InGroupMembQueries": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InGroupMembQueries"), + "Statistic Icmp6InGroupMembQueries.", + nil, nil), + "Icmp6_InGroupMembResponses": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InGroupMembResponses"), + "Statistic Icmp6InGroupMembResponses.", + nil, nil), + "Icmp6_InGroupMembReductions": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InGroupMembReductions"), + "Statistic Icmp6InGroupMembReductions.", + nil, nil), + "Icmp6_InRouterSolicits": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InRouterSolicits"), + "Statistic Icmp6InRouterSolicits.", + nil, nil), + "Icmp6_InRouterAdvertisements": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InRouterAdvertisements"), + "Statistic Icmp6InRouterAdvertisements.", + nil, nil), + "Icmp6_InNeighborSolicits": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InNeighborSolicits"), + "Statistic Icmp6InNeighborSolicits.", + nil, nil), + "Icmp6_InNeighborAdvertisements": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InNeighborAdvertisements"), + "Statistic Icmp6InNeighborAdvertisements.", + nil, nil), + "Icmp6_InRedirects": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InRedirects"), + "Statistic Icmp6InRedirects.", + nil, nil), + "Icmp6_InMLDv2Reports": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InMLDv2Reports"), + "Statistic Icmp6InMLDv2Reports.", + nil, nil), + "Icmp6_OutDestUnreachs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutDestUnreachs"), + "Statistic Icmp6OutDestUnreachs.", + nil, nil), + "Icmp6_OutPktTooBigs": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutPktTooBigs"), + "Statistic Icmp6OutPktTooBigs.", + nil, nil), + "Icmp6_OutTimeExcds": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutTimeExcds"), + "Statistic Icmp6OutTimeExcds.", + nil, nil), + "Icmp6_OutParmProblems": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutParmProblems"), + "Statistic Icmp6OutParmProblems.", + nil, nil), + "Icmp6_OutEchos": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutEchos"), + "Statistic Icmp6OutEchos.", + nil, nil), + "Icmp6_OutEchoReplies": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutEchoReplies"), + "Statistic Icmp6OutEchoReplies.", + nil, nil), + "Icmp6_OutGroupMembQueries": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutGroupMembQueries"), + "Statistic Icmp6OutGroupMembQueries.", + nil, nil), + "Icmp6_OutGroupMembResponses": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutGroupMembResponses"), + "Statistic Icmp6OutGroupMembResponses.", + nil, nil), + "Icmp6_OutGroupMembReductions": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutGroupMembReductions"), + "Statistic Icmp6OutGroupMembReductions.", + nil, nil), + "Icmp6_OutRouterSolicits": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutRouterSolicits"), + "Statistic Icmp6OutRouterSolicits.", + nil, nil), + "Icmp6_OutRouterAdvertisements": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutRouterAdvertisements"), + "Statistic Icmp6OutRouterAdvertisements.", + nil, nil), + "Icmp6_OutNeighborSolicits": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutNeighborSolicits"), + "Statistic Icmp6OutNeighborSolicits.", + nil, nil), + "Icmp6_OutNeighborAdvertisements": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutNeighborAdvertisements"), + "Statistic Icmp6OutNeighborAdvertisements.", + nil, nil), + "Icmp6_OutRedirects": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutRedirects"), + "Statistic Icmp6OutRedirects.", + nil, nil), + "Icmp6_OutMLDv2Reports": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutMLDv2Reports"), + "Statistic Icmp6OutMLDv2Reports.", + nil, nil), + "Icmp6_InType1": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InType1"), + "Statistic Icmp6InType1.", + nil, nil), + "Icmp6_InType134": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InType134"), + "Statistic Icmp6InType134.", + nil, nil), + "Icmp6_InType135": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InType135"), + "Statistic Icmp6InType135.", + nil, nil), + "Icmp6_InType136": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InType136"), + "Statistic Icmp6InType136.", + nil, nil), + "Icmp6_InType143": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_InType143"), + "Statistic Icmp6InType143.", + nil, nil), + "Icmp6_OutType133": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutType133"), + "Statistic Icmp6OutType133.", + nil, nil), + "Icmp6_OutType135": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutType135"), + "Statistic Icmp6OutType135.", + nil, nil), + "Icmp6_OutType136": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutType136"), + "Statistic Icmp6OutType136.", + nil, nil), + "Icmp6_OutType143": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Icmp6_OutType143"), + "Statistic Icmp6OutType143.", + nil, nil), + "Udp6_InDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_InDatagrams"), + "Statistic Udp6InDatagrams.", + nil, nil), + "Udp6_NoPorts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_NoPorts"), + "Statistic Udp6NoPorts.", + nil, nil), + "Udp6_InErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_InErrors"), + "Statistic Udp6InErrors.", + nil, nil), + "Udp6_OutDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_OutDatagrams"), + "Statistic Udp6OutDatagrams.", + nil, nil), + "Udp6_RcvbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_RcvbufErrors"), + "Statistic Udp6RcvbufErrors.", + nil, nil), + "Udp6_SndbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_SndbufErrors"), + "Statistic Udp6SndbufErrors.", + nil, nil), + "Udp6_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_InCsumErrors"), + "Statistic Udp6InCsumErrors.", + nil, nil), + "Udp6_IgnoredMulti": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "Udp6_IgnoredMulti"), + "Statistic Udp6IgnoredMulti.", + nil, nil), + "UdpLite6_InDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite6_InDatagrams"), + "Statistic UdpLite6InDatagrams.", + nil, nil), + "UdpLite6_NoPorts": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite6_NoPorts"), + "Statistic UdpLite6NoPorts.", + nil, nil), + "UdpLite6_InErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite6_InErrors"), + "Statistic UdpLite6InErrors.", + nil, nil), + "UdpLite6_OutDatagrams": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite6_OutDatagrams"), + "Statistic UdpLite6OutDatagrams.", + nil, nil), + "UdpLite6_RcvbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite6_RcvbufErrors"), + "Statistic UdpLite6RcvbufErrors.", + nil, nil), + "UdpLite6_SndbufErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite6_SndbufErrors"), + "Statistic UdpLite6SndbufErrors.", + nil, nil), + "UdpLite6_InCsumErrors": prometheus.NewDesc( + prometheus.BuildFQName(namespace, netStatsSubsystem, "UdpLite6_InCsumErrors"), + "Statistic UdpLite6InCsumErrors.", + nil, nil), + } +} diff --git a/collector/netstat_linux.go b/collector/netstat_linux.go index 5065a19af3..07713895da 100644 --- a/collector/netstat_linux.go +++ b/collector/netstat_linux.go @@ -13,22 +13,20 @@ //go:build !nonetstat +// Regenerate the explicit descriptor table after a procfs upgrade: +//go:generate go run netstat_descs_gen.go + package collector import ( - "bufio" - "errors" "fmt" - "io" "log/slog" - "maps" - "os" + "reflect" "regexp" - "strconv" - "strings" "github.com/alecthomas/kingpin/v2" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/procfs" ) const ( @@ -37,9 +35,15 @@ const ( var ( netStatFields = kingpin.Flag("collector.netstat.fields", "Regexp of fields to return for netstat collector.").Default("^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans|TCPTimeouts|TCPOFOQueue|TCPRcvQDrop)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$").String() + + // netStatDescs holds the explicit metric descriptors, allocated once at + // package init (see netstat_descs_linux.go) so collection never calls + // prometheus.NewDesc per scrape. + netStatDescs = netStatMetricDescs() ) type netStatCollector struct { + proc procfs.Proc fieldPattern *regexp.Regexp logger *slog.Logger } @@ -52,124 +56,79 @@ func init() { // a new Collector exposing network stats. func NewNetStatCollector(logger *slog.Logger) (Collector, error) { pattern := regexp.MustCompile(*netStatFields) + fs, err := procfs.NewFS(*procPath) + if err != nil { + return nil, fmt.Errorf("failed to open procfs: %w", err) + } + + // Network statistics in /proc/net are network namespace local. Reading + // them via the current process' /proc/self/net keeps the same semantics + // while allowing the use of the procfs parsers. + proc, err := fs.Self() + if err != nil { + return nil, fmt.Errorf("failed to open /proc/self: %w", err) + } + return &netStatCollector{ + proc: proc, fieldPattern: pattern, logger: logger, }, nil } func (c *netStatCollector) Update(ch chan<- prometheus.Metric) error { - netStats, err := getNetStats(procFilePath("net/netstat")) + netStats, err := c.proc.Netstat() if err != nil { return fmt.Errorf("couldn't get netstats: %w", err) } - snmpStats, err := getNetStats(procFilePath("net/snmp")) + snmpStats, err := c.proc.Snmp() if err != nil { return fmt.Errorf("couldn't get SNMP stats: %w", err) } - snmp6Stats, err := getSNMP6Stats(procFilePath("net/snmp6")) + snmp6Stats, err := c.proc.Snmp6() if err != nil { return fmt.Errorf("couldn't get SNMP6 stats: %w", err) } - // Merge the results of snmpStats into netStats (collisions are possible, but - // we know that the keys are always unique for the given use case). - maps.Copy(netStats, snmpStats) - maps.Copy(netStats, snmp6Stats) - for protocol, protocolStats := range netStats { - for name, value := range protocolStats { - key := protocol + "_" + name - v, err := strconv.ParseFloat(value, 64) - if err != nil { - return fmt.Errorf("invalid value %s in netstats: %w", value, err) - } - if !c.fieldPattern.MatchString(key) { - continue - } - ch <- prometheus.MustNewConstMetric( - prometheus.NewDesc( - prometheus.BuildFQName(namespace, netStatsSubsystem, key), - fmt.Sprintf("Statistic %s.", protocol+name), - nil, nil, - ), - prometheus.UntypedValue, v, - ) - } - } - return nil -} -func getNetStats(fileName string) (map[string]map[string]string, error) { - file, err := os.Open(fileName) - if err != nil { - return nil, err - } - defer file.Close() + c.emitStruct(ch, netStats.TcpExt) + c.emitStruct(ch, netStats.IpExt) + c.emitStruct(ch, snmpStats.Ip) + c.emitStruct(ch, snmpStats.Icmp) + c.emitStruct(ch, snmpStats.IcmpMsg) + c.emitStruct(ch, snmpStats.Tcp) + c.emitStruct(ch, snmpStats.Udp) + c.emitStruct(ch, snmpStats.UdpLite) + c.emitStruct(ch, snmp6Stats.Ip6) + c.emitStruct(ch, snmp6Stats.Icmp6) + c.emitStruct(ch, snmp6Stats.Udp6) + c.emitStruct(ch, snmp6Stats.UdpLite6) - return parseNetStats(file, fileName) + return nil } -func parseNetStats(r io.Reader, fileName string) (map[string]map[string]string, error) { - var ( - netStats = map[string]map[string]string{} - scanner = bufio.NewScanner(r) - ) - - for scanner.Scan() { - nameParts := strings.Split(scanner.Text(), " ") - scanner.Scan() - valueParts := strings.Split(scanner.Text(), " ") - // Remove trailing :. - protocol := nameParts[0][:len(nameParts[0])-1] - netStats[protocol] = map[string]string{} - if len(nameParts) != len(valueParts) { - return nil, fmt.Errorf("mismatch field count mismatch in %s: %s", - fileName, protocol) - } - for i := 1; i < len(nameParts); i++ { - netStats[protocol][nameParts[i]] = valueParts[i] - } - } - - return netStats, scanner.Err() -} +// emitStruct emits one metric per non-nil field of a procfs netstat/snmp +// statistics struct, using the struct's type name as the protocol name and +// looking up the pre-built descriptor by "_". +func (c *netStatCollector) emitStruct(ch chan<- prometheus.Metric, stats any) { + v := reflect.ValueOf(stats) + protocol := v.Type().Name() -func getSNMP6Stats(fileName string) (map[string]map[string]string, error) { - file, err := os.Open(fileName) - if err != nil { - // On systems with IPv6 disabled, this file won't exist. - // Do nothing. - if errors.Is(err, os.ErrNotExist) { - return nil, nil + for i := 0; i < v.NumField(); i++ { + value, ok := v.Field(i).Interface().(*float64) + if !ok || value == nil { + continue } - return nil, err - } - defer file.Close() - - return parseSNMP6Stats(file) -} - -func parseSNMP6Stats(r io.Reader) (map[string]map[string]string, error) { - var ( - netStats = map[string]map[string]string{} - scanner = bufio.NewScanner(r) - ) - - for scanner.Scan() { - stat := strings.Fields(scanner.Text()) - if len(stat) < 2 { + name := v.Type().Field(i).Name + key := protocol + "_" + name + desc, ok := netStatDescs[key] + if !ok { continue } - // Expect to have "6" in metric name, skip line otherwise - if sixIndex := strings.Index(stat[0], "6"); sixIndex != -1 { - protocol := stat[0][:sixIndex+1] - name := stat[0][sixIndex+1:] - if _, present := netStats[protocol]; !present { - netStats[protocol] = map[string]string{} - } - netStats[protocol][name] = stat[1] + if !c.fieldPattern.MatchString(key) { + continue } - } - return netStats, scanner.Err() + ch <- prometheus.MustNewConstMetric(desc, prometheus.UntypedValue, *value) + } } diff --git a/collector/netstat_linux_test.go b/collector/netstat_linux_test.go index a30f44a2c9..8ba3a9dd30 100644 --- a/collector/netstat_linux_test.go +++ b/collector/netstat_linux_test.go @@ -16,83 +16,174 @@ package collector import ( - "os" + "io" + "log/slog" + "strings" "testing" + + "github.com/alecthomas/kingpin/v2" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" ) -func TestNetStats(t *testing.T) { - testNetStats(t, "fixtures/proc/net/netstat") - testSNMPStats(t, "fixtures/proc/net/snmp") - testSNMP6Stats(t, "fixtures/proc/net/snmp6") +type testNetStatCollector struct { + c Collector } -func testNetStats(t *testing.T, fileName string) { - file, err := os.Open(fileName) - if err != nil { - t.Fatal(err) - } - defer file.Close() - - netStats, err := parseNetStats(file, fileName) - if err != nil { - t.Fatal(err) - } - - if want, got := "102471", netStats["TcpExt"]["DelayedACKs"]; want != got { - t.Errorf("want netstat TCP DelayedACKs %s, got %s", want, got) - } +func (c testNetStatCollector) Collect(ch chan<- prometheus.Metric) { + c.c.Update(ch) +} - if want, got := "2786264347", netStats["IpExt"]["OutOctets"]; want != got { - t.Errorf("want netstat IP OutOctets %s, got %s", want, got) - } +func (c testNetStatCollector) Describe(ch chan<- *prometheus.Desc) { + prometheus.DescribeByCollect(c, ch) } -func testSNMPStats(t *testing.T, fileName string) { - file, err := os.Open(fileName) - if err != nil { - t.Fatal(err) - } - defer file.Close() +func NewTestNetStatCollector(t *testing.T, logger *slog.Logger) prometheus.Collector { + t.Helper() - snmpStats, err := parseNetStats(file, fileName) + c, err := NewNetStatCollector(logger) if err != nil { t.Fatal(err) } - - if want, got := "9", snmpStats["Udp"]["RcvbufErrors"]; want != got { - t.Errorf("want netstat Udp RcvbufErrors %s, got %s", want, got) - } - - if want, got := "8", snmpStats["Udp"]["SndbufErrors"]; want != got { - t.Errorf("want netstat Udp SndbufErrors %s, got %s", want, got) - } + return testNetStatCollector{c: c} } -func testSNMP6Stats(t *testing.T, fileName string) { - file, err := os.Open(fileName) - if err != nil { - t.Fatal(err) - } - defer file.Close() - - snmp6Stats, err := parseSNMP6Stats(file) - if err != nil { +func TestNetStats(t *testing.T) { + if _, err := kingpin.CommandLine.Parse([]string{}); err != nil { t.Fatal(err) } - - if want, got := "460", snmp6Stats["Ip6"]["InOctets"]; want != got { - t.Errorf("want netstat IPv6 InOctets %s, got %s", want, got) - } - - if want, got := "8", snmp6Stats["Icmp6"]["OutMsgs"]; want != got { - t.Errorf("want netstat ICPM6 OutMsgs %s, got %s", want, got) - } - - if want, got := "9", snmp6Stats["Udp6"]["RcvbufErrors"]; want != got { - t.Errorf("want netstat Udp6 RcvbufErrors %s, got %s", want, got) - } - - if want, got := "8", snmp6Stats["Udp6"]["SndbufErrors"]; want != got { - t.Errorf("want netstat Udp6 SndbufErrors %s, got %s", want, got) + *procPath = "fixtures/proc" + + logger := slog.New(slog.NewTextHandler(io.Discard, nil)) + c := NewTestNetStatCollector(t, logger) + + expected := ` +# HELP node_netstat_Icmp6_InErrors Statistic Icmp6InErrors. +# TYPE node_netstat_Icmp6_InErrors untyped +node_netstat_Icmp6_InErrors 0 +# HELP node_netstat_Icmp6_InMsgs Statistic Icmp6InMsgs. +# TYPE node_netstat_Icmp6_InMsgs untyped +node_netstat_Icmp6_InMsgs 0 +# HELP node_netstat_Icmp6_OutMsgs Statistic Icmp6OutMsgs. +# TYPE node_netstat_Icmp6_OutMsgs untyped +node_netstat_Icmp6_OutMsgs 8 +# HELP node_netstat_Icmp_InErrors Statistic IcmpInErrors. +# TYPE node_netstat_Icmp_InErrors untyped +node_netstat_Icmp_InErrors 0 +# HELP node_netstat_Icmp_InMsgs Statistic IcmpInMsgs. +# TYPE node_netstat_Icmp_InMsgs untyped +node_netstat_Icmp_InMsgs 104 +# HELP node_netstat_Icmp_OutMsgs Statistic IcmpOutMsgs. +# TYPE node_netstat_Icmp_OutMsgs untyped +node_netstat_Icmp_OutMsgs 120 +# HELP node_netstat_Ip6_InOctets Statistic Ip6InOctets. +# TYPE node_netstat_Ip6_InOctets untyped +node_netstat_Ip6_InOctets 460 +# HELP node_netstat_Ip6_OutOctets Statistic Ip6OutOctets. +# TYPE node_netstat_Ip6_OutOctets untyped +node_netstat_Ip6_OutOctets 536 +# HELP node_netstat_IpExt_InOctets Statistic IpExtInOctets. +# TYPE node_netstat_IpExt_InOctets untyped +node_netstat_IpExt_InOctets 6.28639697e+09 +# HELP node_netstat_IpExt_OutOctets Statistic IpExtOutOctets. +# TYPE node_netstat_IpExt_OutOctets untyped +node_netstat_IpExt_OutOctets 2.786264347e+09 +# HELP node_netstat_Ip_Forwarding Statistic IpForwarding. +# TYPE node_netstat_Ip_Forwarding untyped +node_netstat_Ip_Forwarding 1 +# HELP node_netstat_TcpExt_ListenDrops Statistic TcpExtListenDrops. +# TYPE node_netstat_TcpExt_ListenDrops untyped +node_netstat_TcpExt_ListenDrops 0 +# HELP node_netstat_TcpExt_ListenOverflows Statistic TcpExtListenOverflows. +# TYPE node_netstat_TcpExt_ListenOverflows untyped +node_netstat_TcpExt_ListenOverflows 0 +# HELP node_netstat_TcpExt_SyncookiesFailed Statistic TcpExtSyncookiesFailed. +# TYPE node_netstat_TcpExt_SyncookiesFailed untyped +node_netstat_TcpExt_SyncookiesFailed 2 +# HELP node_netstat_TcpExt_SyncookiesRecv Statistic TcpExtSyncookiesRecv. +# TYPE node_netstat_TcpExt_SyncookiesRecv untyped +node_netstat_TcpExt_SyncookiesRecv 0 +# HELP node_netstat_TcpExt_SyncookiesSent Statistic TcpExtSyncookiesSent. +# TYPE node_netstat_TcpExt_SyncookiesSent untyped +node_netstat_TcpExt_SyncookiesSent 0 +# HELP node_netstat_TcpExt_TCPOFOQueue Statistic TcpExtTCPOFOQueue. +# TYPE node_netstat_TcpExt_TCPOFOQueue untyped +node_netstat_TcpExt_TCPOFOQueue 42 +# HELP node_netstat_TcpExt_TCPRcvQDrop Statistic TcpExtTCPRcvQDrop. +# TYPE node_netstat_TcpExt_TCPRcvQDrop untyped +node_netstat_TcpExt_TCPRcvQDrop 131 +# HELP node_netstat_TcpExt_TCPTimeouts Statistic TcpExtTCPTimeouts. +# TYPE node_netstat_TcpExt_TCPTimeouts untyped +node_netstat_TcpExt_TCPTimeouts 115 +# HELP node_netstat_Tcp_ActiveOpens Statistic TcpActiveOpens. +# TYPE node_netstat_Tcp_ActiveOpens untyped +node_netstat_Tcp_ActiveOpens 3556 +# HELP node_netstat_Tcp_CurrEstab Statistic TcpCurrEstab. +# TYPE node_netstat_Tcp_CurrEstab untyped +node_netstat_Tcp_CurrEstab 0 +# HELP node_netstat_Tcp_InErrs Statistic TcpInErrs. +# TYPE node_netstat_Tcp_InErrs untyped +node_netstat_Tcp_InErrs 5 +# HELP node_netstat_Tcp_InSegs Statistic TcpInSegs. +# TYPE node_netstat_Tcp_InSegs untyped +node_netstat_Tcp_InSegs 5.7252008e+07 +# HELP node_netstat_Tcp_OutRsts Statistic TcpOutRsts. +# TYPE node_netstat_Tcp_OutRsts untyped +node_netstat_Tcp_OutRsts 1003 +# HELP node_netstat_Tcp_OutSegs Statistic TcpOutSegs. +# TYPE node_netstat_Tcp_OutSegs untyped +node_netstat_Tcp_OutSegs 5.4915039e+07 +# HELP node_netstat_Tcp_PassiveOpens Statistic TcpPassiveOpens. +# TYPE node_netstat_Tcp_PassiveOpens untyped +node_netstat_Tcp_PassiveOpens 230 +# HELP node_netstat_Tcp_RetransSegs Statistic TcpRetransSegs. +# TYPE node_netstat_Tcp_RetransSegs untyped +node_netstat_Tcp_RetransSegs 227 +# HELP node_netstat_Udp6_InDatagrams Statistic Udp6InDatagrams. +# TYPE node_netstat_Udp6_InDatagrams untyped +node_netstat_Udp6_InDatagrams 0 +# HELP node_netstat_Udp6_InErrors Statistic Udp6InErrors. +# TYPE node_netstat_Udp6_InErrors untyped +node_netstat_Udp6_InErrors 0 +# HELP node_netstat_Udp6_NoPorts Statistic Udp6NoPorts. +# TYPE node_netstat_Udp6_NoPorts untyped +node_netstat_Udp6_NoPorts 0 +# HELP node_netstat_Udp6_OutDatagrams Statistic Udp6OutDatagrams. +# TYPE node_netstat_Udp6_OutDatagrams untyped +node_netstat_Udp6_OutDatagrams 0 +# HELP node_netstat_Udp6_RcvbufErrors Statistic Udp6RcvbufErrors. +# TYPE node_netstat_Udp6_RcvbufErrors untyped +node_netstat_Udp6_RcvbufErrors 9 +# HELP node_netstat_Udp6_SndbufErrors Statistic Udp6SndbufErrors. +# TYPE node_netstat_Udp6_SndbufErrors untyped +node_netstat_Udp6_SndbufErrors 8 +# HELP node_netstat_UdpLite6_InErrors Statistic UdpLite6InErrors. +# TYPE node_netstat_UdpLite6_InErrors untyped +node_netstat_UdpLite6_InErrors 0 +# HELP node_netstat_UdpLite_InErrors Statistic UdpLiteInErrors. +# TYPE node_netstat_UdpLite_InErrors untyped +node_netstat_UdpLite_InErrors 0 +# HELP node_netstat_Udp_InDatagrams Statistic UdpInDatagrams. +# TYPE node_netstat_Udp_InDatagrams untyped +node_netstat_Udp_InDatagrams 88542 +# HELP node_netstat_Udp_InErrors Statistic UdpInErrors. +# TYPE node_netstat_Udp_InErrors untyped +node_netstat_Udp_InErrors 0 +# HELP node_netstat_Udp_NoPorts Statistic UdpNoPorts. +# TYPE node_netstat_Udp_NoPorts untyped +node_netstat_Udp_NoPorts 120 +# HELP node_netstat_Udp_OutDatagrams Statistic UdpOutDatagrams. +# TYPE node_netstat_Udp_OutDatagrams untyped +node_netstat_Udp_OutDatagrams 53028 +# HELP node_netstat_Udp_RcvbufErrors Statistic UdpRcvbufErrors. +# TYPE node_netstat_Udp_RcvbufErrors untyped +node_netstat_Udp_RcvbufErrors 9 +# HELP node_netstat_Udp_SndbufErrors Statistic UdpSndbufErrors. +# TYPE node_netstat_Udp_SndbufErrors untyped +node_netstat_Udp_SndbufErrors 8 +` + + if err := testutil.CollectAndCompare(c, strings.NewReader(expected)); err != nil { + t.Errorf("unexpected collecting result:\n%s", err) } } diff --git a/go.mod b/go.mod index 7fa9aaa664..051e8f2be2 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/prometheus/client_model v0.6.2 github.com/prometheus/common v0.70.1 github.com/prometheus/exporter-toolkit v0.19.0 - github.com/prometheus/procfs v0.21.1 + github.com/prometheus/procfs v0.22.0 github.com/safchain/ethtool v0.7.0 golang.org/x/sys v0.47.0 howett.net/plist v1.0.1 diff --git a/go.sum b/go.sum index b6f9aef455..b165d23162 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi github.com/prometheus/common v0.70.1/go.mod h1:VdFUQDMZK3VLkurFUVhia6uys/0suUp86TJz5qbJRhc= github.com/prometheus/exporter-toolkit v0.19.0 h1:JljWCzE5naAiZ7Ukeb8PwjNbU+WwISuW0ktgdXMnMhc= github.com/prometheus/exporter-toolkit v0.19.0/go.mod h1:kOoEK/7wbe2Ns33l7wYHOXDZAZ/XGLyJqoGwmJxK+QU= -github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI= -github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY= +github.com/prometheus/procfs v0.22.0 h1:6q9+/JL9IKAPbCmBrv9n5O5Ty3NKnciV5X7YGw0oics= +github.com/prometheus/procfs v0.22.0/go.mod h1:CvmFr/GVhIjIvWJZW3tgkODBQMRIf0EyWMQLHCHab58= github.com/safchain/ethtool v0.7.0 h1:rlJzfDetsVvT61uz8x1YIcFn12akMfuPulHtZjtb7Is= github.com/safchain/ethtool v0.7.0/go.mod h1:MenQKEjXdfkjD3mp2QdCk8B/hwvkrlOTm/FD4gTpFxQ= github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973 h1:GfSdC6wKfTGcgCS7BtzF5694Amne1pGCSTY252WhlEY=