mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-01 08:06:38 +00:00
nps: refactor collector (#1764)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
32
internal/collector/nps/const.go
Normal file
32
internal/collector/nps/const.go
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package nps
|
||||||
|
|
||||||
|
const (
|
||||||
|
// NPS Authentication Server
|
||||||
|
accessAccepts = "Access-Accepts"
|
||||||
|
accessChallenges = "Access-Challenges"
|
||||||
|
accessRejects = "Access-Rejects"
|
||||||
|
accessRequests = "Access-Requests"
|
||||||
|
accessBadAuthenticators = "Bad Authenticators"
|
||||||
|
accessDroppedPackets = "Dropped Packets"
|
||||||
|
accessInvalidRequests = "Invalid Requests"
|
||||||
|
accessMalformedPackets = "Malformed Packets"
|
||||||
|
accessPacketsReceived = "Packets Received"
|
||||||
|
accessPacketsSent = "Packets Sent"
|
||||||
|
accessServerResetTime = "Server Reset Time"
|
||||||
|
accessServerUpTime = "Server Up Time"
|
||||||
|
accessUnknownType = "Unknown Type"
|
||||||
|
|
||||||
|
// NPS Accounting Server
|
||||||
|
accountingRequests = "Accounting-Requests"
|
||||||
|
accountingResponses = "Accounting-Responses"
|
||||||
|
accountingBadAuthenticators = "Bad Authenticators"
|
||||||
|
accountingDroppedPackets = "Dropped Packets"
|
||||||
|
accountingInvalidRequests = "Invalid Requests"
|
||||||
|
accountingMalformedPackets = "Malformed Packets"
|
||||||
|
accountingNoRecord = "No Record"
|
||||||
|
accountingPacketsReceived = "Packets Received"
|
||||||
|
accountingPacketsSent = "Packets Sent"
|
||||||
|
accountingServerResetTime = "Server Reset Time"
|
||||||
|
accountingServerUpTime = "Server Up Time"
|
||||||
|
accountingUnknownType = "Unknown Type"
|
||||||
|
)
|
||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
"github.com/alecthomas/kingpin/v2"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||||
|
"github.com/prometheus-community/windows_exporter/internal/perfdata"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
@@ -20,12 +21,9 @@ type Config struct{}
|
|||||||
var ConfigDefaults = Config{}
|
var ConfigDefaults = Config{}
|
||||||
|
|
||||||
type Collector struct {
|
type Collector struct {
|
||||||
config Config
|
config Config
|
||||||
miSession *mi.Session
|
|
||||||
|
|
||||||
miQueryAuthenticationServer mi.Query
|
|
||||||
miQueryAccountingServer mi.Query
|
|
||||||
|
|
||||||
|
accessPerfDataCollector *perfdata.Collector
|
||||||
accessAccepts *prometheus.Desc
|
accessAccepts *prometheus.Desc
|
||||||
accessChallenges *prometheus.Desc
|
accessChallenges *prometheus.Desc
|
||||||
accessRejects *prometheus.Desc
|
accessRejects *prometheus.Desc
|
||||||
@@ -40,6 +38,7 @@ type Collector struct {
|
|||||||
accessServerUpTime *prometheus.Desc
|
accessServerUpTime *prometheus.Desc
|
||||||
accessUnknownType *prometheus.Desc
|
accessUnknownType *prometheus.Desc
|
||||||
|
|
||||||
|
accountingPerfDataCollector *perfdata.Collector
|
||||||
accountingRequests *prometheus.Desc
|
accountingRequests *prometheus.Desc
|
||||||
accountingResponses *prometheus.Desc
|
accountingResponses *prometheus.Desc
|
||||||
accountingBadAuthenticators *prometheus.Desc
|
accountingBadAuthenticators *prometheus.Desc
|
||||||
@@ -78,26 +77,48 @@ func (c *Collector) Close() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, miSession *mi.Session) error {
|
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||||
if miSession == nil {
|
var err error
|
||||||
return errors.New("miSession is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
miQueryAuthenticationServer, err := mi.NewQuery("SELECT * FROM Win32_PerfRawData_IAS_NPSAuthenticationServer")
|
errs := make([]error, 0, 2)
|
||||||
|
|
||||||
|
c.accessPerfDataCollector, err = perfdata.NewCollector("NPS Authentication Server", nil, []string{
|
||||||
|
accessAccepts,
|
||||||
|
accessChallenges,
|
||||||
|
accessRejects,
|
||||||
|
accessRequests,
|
||||||
|
accessBadAuthenticators,
|
||||||
|
accessDroppedPackets,
|
||||||
|
accessInvalidRequests,
|
||||||
|
accessMalformedPackets,
|
||||||
|
accessPacketsReceived,
|
||||||
|
accessPacketsSent,
|
||||||
|
accessServerResetTime,
|
||||||
|
accessServerUpTime,
|
||||||
|
accessUnknownType,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create WMI query: %w", err)
|
errs = append(errs, fmt.Errorf("failed to create NPS Authentication Server collector: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
c.miQueryAuthenticationServer = miQueryAuthenticationServer
|
c.accountingPerfDataCollector, err = perfdata.NewCollector("NPS Accounting Server", nil, []string{
|
||||||
|
accountingRequests,
|
||||||
miQueryAccountingServer, err := mi.NewQuery("SELECT * FROM Win32_PerfRawData_IAS_NPSAccountingServer")
|
accountingResponses,
|
||||||
|
accountingBadAuthenticators,
|
||||||
|
accountingDroppedPackets,
|
||||||
|
accountingInvalidRequests,
|
||||||
|
accountingMalformedPackets,
|
||||||
|
accountingNoRecord,
|
||||||
|
accountingPacketsReceived,
|
||||||
|
accountingPacketsSent,
|
||||||
|
accountingServerResetTime,
|
||||||
|
accountingServerUpTime,
|
||||||
|
accountingUnknownType,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create WMI query: %w", err)
|
errs = append(errs, fmt.Errorf("failed to create NPS Accounting Server collector: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
c.miQueryAccountingServer = miQueryAccountingServer
|
|
||||||
c.miSession = miSession
|
|
||||||
|
|
||||||
c.accessAccepts = prometheus.NewDesc(
|
c.accessAccepts = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "access_accepts"),
|
prometheus.BuildFQName(types.Namespace, Name, "access_accepts"),
|
||||||
"(AccessAccepts)",
|
"(AccessAccepts)",
|
||||||
@@ -250,7 +271,7 @@ func (c *Collector) Build(_ *slog.Logger, miSession *mi.Session) error {
|
|||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
return errors.Join(errs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
// Collect sends the metric values for each metric
|
||||||
@@ -258,219 +279,192 @@ func (c *Collector) Build(_ *slog.Logger, miSession *mi.Session) error {
|
|||||||
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||||
errs := make([]error, 0, 2)
|
errs := make([]error, 0, 2)
|
||||||
|
|
||||||
if err := c.CollectAccept(ch); err != nil {
|
if err := c.collectAccept(ch); err != nil {
|
||||||
errs = append(errs, fmt.Errorf("failed collecting NPS accept data: %w", err))
|
errs = append(errs, fmt.Errorf("failed collecting NPS accept data: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.CollectAccounting(ch); err != nil {
|
if err := c.collectAccounting(ch); err != nil {
|
||||||
errs = append(errs, fmt.Errorf("failed collecting NPS accounting data: %w", err))
|
errs = append(errs, fmt.Errorf("failed collecting NPS accounting data: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.Join(errs...)
|
return errors.Join(errs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Win32_PerfRawData_IAS_NPSAuthenticationServer docs:
|
// collectAccept sends the metric values for each metric
|
||||||
// at the moment there is no Microsoft documentation.
|
|
||||||
type Win32_PerfRawData_IAS_NPSAuthenticationServer struct {
|
|
||||||
Name string `mi:"Name"`
|
|
||||||
|
|
||||||
AccessAccepts uint32 `mi:"AccessAccepts"`
|
|
||||||
AccessChallenges uint32 `mi:"AccessChallenges"`
|
|
||||||
AccessRejects uint32 `mi:"AccessRejects"`
|
|
||||||
AccessRequests uint32 `mi:"AccessRequests"`
|
|
||||||
AccessBadAuthenticators uint32 `mi:"AccessBadAuthenticators"`
|
|
||||||
AccessDroppedPackets uint32 `mi:"AccessDroppedPackets"`
|
|
||||||
AccessInvalidRequests uint32 `mi:"AccessInvalidRequests"`
|
|
||||||
AccessMalformedPackets uint32 `mi:"AccessMalformedPackets"`
|
|
||||||
AccessPacketsReceived uint32 `mi:"AccessPacketsReceived"`
|
|
||||||
AccessPacketsSent uint32 `mi:"AccessPacketsSent"`
|
|
||||||
AccessServerResetTime uint32 `mi:"AccessServerResetTime"`
|
|
||||||
AccessServerUpTime uint32 `mi:"AccessServerUpTime"`
|
|
||||||
AccessUnknownType uint32 `mi:"AccessUnknownType"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Win32_PerfRawData_IAS_NPSAccountingServer struct {
|
|
||||||
Name string `mi:"Name"`
|
|
||||||
|
|
||||||
AccountingRequests uint32 `mi:"AccountingRequests"`
|
|
||||||
AccountingResponses uint32 `mi:"AccountingResponses"`
|
|
||||||
AccountingBadAuthenticators uint32 `mi:"AccountingBadAuthenticators"`
|
|
||||||
AccountingDroppedPackets uint32 `mi:"AccountingDroppedPackets"`
|
|
||||||
AccountingInvalidRequests uint32 `mi:"AccountingInvalidRequests"`
|
|
||||||
AccountingMalformedPackets uint32 `mi:"AccountingMalformedPackets"`
|
|
||||||
AccountingNoRecord uint32 `mi:"AccountingNoRecord"`
|
|
||||||
AccountingPacketsReceived uint32 `mi:"AccountingPacketsReceived"`
|
|
||||||
AccountingPacketsSent uint32 `mi:"AccountingPacketsSent"`
|
|
||||||
AccountingServerResetTime uint32 `mi:"AccountingServerResetTime"`
|
|
||||||
AccountingServerUpTime uint32 `mi:"AccountingServerUpTime"`
|
|
||||||
AccountingUnknownType uint32 `mi:"AccountingUnknownType"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CollectAccept sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
// to the provided prometheus Metric channel.
|
||||||
func (c *Collector) CollectAccept(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectAccept(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_IAS_NPSAuthenticationServer
|
perfData, err := c.accessPerfDataCollector.Collect()
|
||||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, c.miQueryAuthenticationServer); err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("WMI query failed: %w", err)
|
return fmt.Errorf("failed to collect NPS Authentication Server metrics: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
data, ok := perfData[perfdata.EmptyInstance]
|
||||||
|
if !ok {
|
||||||
|
return errors.New("perflib query for NPS Authentication Server returned empty result set")
|
||||||
}
|
}
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessAccepts,
|
c.accessAccepts,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessAccepts),
|
data[accessAccepts].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessChallenges,
|
c.accessChallenges,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessChallenges),
|
data[accessChallenges].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessRejects,
|
c.accessRejects,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessRejects),
|
data[accessRejects].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessRequests,
|
c.accessRequests,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessRequests),
|
data[accessRequests].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessBadAuthenticators,
|
c.accessBadAuthenticators,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessBadAuthenticators),
|
data[accessBadAuthenticators].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessDroppedPackets,
|
c.accessDroppedPackets,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessDroppedPackets),
|
data[accessDroppedPackets].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessInvalidRequests,
|
c.accessInvalidRequests,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessInvalidRequests),
|
data[accessInvalidRequests].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessMalformedPackets,
|
c.accessMalformedPackets,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessMalformedPackets),
|
data[accessMalformedPackets].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessPacketsReceived,
|
c.accessPacketsReceived,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessPacketsReceived),
|
data[accessPacketsReceived].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessPacketsSent,
|
c.accessPacketsSent,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessPacketsSent),
|
data[accessPacketsSent].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessServerResetTime,
|
c.accessServerResetTime,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessServerResetTime),
|
data[accessServerResetTime].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessServerUpTime,
|
c.accessServerUpTime,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessServerUpTime),
|
data[accessServerUpTime].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessUnknownType,
|
c.accessUnknownType,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccessUnknownType),
|
data[accessUnknownType].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) CollectAccounting(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectAccounting(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_IAS_NPSAccountingServer
|
perfData, err := c.accountingPerfDataCollector.Collect()
|
||||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, c.miQueryAccountingServer); err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("WMI query failed: %w", err)
|
return fmt.Errorf("failed to collect NPS Accounting Server metrics: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
data, ok := perfData[perfdata.EmptyInstance]
|
||||||
|
if !ok {
|
||||||
|
return errors.New("perflib query for NPS Accounting Server returned empty result set")
|
||||||
}
|
}
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingRequests,
|
c.accountingRequests,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingRequests),
|
data[accountingRequests].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingResponses,
|
c.accountingResponses,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingResponses),
|
data[accountingResponses].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingBadAuthenticators,
|
c.accountingBadAuthenticators,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingBadAuthenticators),
|
data[accountingBadAuthenticators].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingDroppedPackets,
|
c.accountingDroppedPackets,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingDroppedPackets),
|
data[accountingDroppedPackets].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingInvalidRequests,
|
c.accountingInvalidRequests,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingInvalidRequests),
|
data[accountingInvalidRequests].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingMalformedPackets,
|
c.accountingMalformedPackets,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingMalformedPackets),
|
data[accountingMalformedPackets].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingNoRecord,
|
c.accountingNoRecord,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingNoRecord),
|
data[accountingNoRecord].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingPacketsReceived,
|
c.accountingPacketsReceived,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingPacketsReceived),
|
data[accountingPacketsReceived].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingPacketsSent,
|
c.accountingPacketsSent,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingPacketsSent),
|
data[accountingPacketsSent].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingServerResetTime,
|
c.accountingServerResetTime,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingServerResetTime),
|
data[accountingServerResetTime].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingServerUpTime,
|
c.accountingServerUpTime,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingServerUpTime),
|
data[accountingServerUpTime].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accountingUnknownType,
|
c.accountingUnknownType,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].AccountingUnknownType),
|
data[accountingUnknownType].FirstValue,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user