mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-08 05:39:04 +02:00
exchange: export LDAP average-timer denominator counters for ADAccess metrics (#2474)
Co-authored-by: jkroepke <1560587+jkroepke@users.noreply.github.com> Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
co-authored by
jkroepke
Jan-Otto Kröpke
parent
b85c86295c
commit
d2100abf8a
@@ -30,9 +30,12 @@ type collectorADAccessProcesses struct {
|
||||
perfDataCollectorADAccessProcesses *pdh.Collector
|
||||
perfDataObjectADAccessProcesses []perfDataCounterValuesADAccessProcesses
|
||||
|
||||
ldapReadOperations *prometheus.Desc
|
||||
ldapReadTime *prometheus.Desc
|
||||
ldapSearchOperations *prometheus.Desc
|
||||
ldapSearchTime *prometheus.Desc
|
||||
ldapTimeoutErrorsPerSec *prometheus.Desc
|
||||
ldapWriteOperations *prometheus.Desc
|
||||
ldapWriteTime *prometheus.Desc
|
||||
longRunningLDAPOperationsPerMin *prometheus.Desc
|
||||
}
|
||||
@@ -41,8 +44,11 @@ type perfDataCounterValuesADAccessProcesses struct {
|
||||
Name string
|
||||
|
||||
LdapReadTime float64 `perfdata:"LDAP Read Time"`
|
||||
LdapReadOperationsTotal float64 `perfdata:"LDAP Read Time,secondvalue"`
|
||||
LdapSearchTime float64 `perfdata:"LDAP Search Time"`
|
||||
LdapSearchOperationsTotal float64 `perfdata:"LDAP Search Time,secondvalue"`
|
||||
LdapWriteTime float64 `perfdata:"LDAP Write Time"`
|
||||
LdapWriteOperationsTotal float64 `perfdata:"LDAP Write Time,secondvalue"`
|
||||
LdapTimeoutErrorsPerSec float64 `perfdata:"LDAP Timeout Errors/sec"`
|
||||
LongRunningLDAPOperationsPerMin float64 `perfdata:"Long Running LDAP Operations/min"`
|
||||
}
|
||||
@@ -61,18 +67,36 @@ func (c *Collector) buildADAccessProcesses() error {
|
||||
[]string{"name"},
|
||||
nil,
|
||||
)
|
||||
c.ldapReadOperations = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "ldap_read_operations_total"),
|
||||
"Total number of LDAP read operations",
|
||||
[]string{"name"},
|
||||
nil,
|
||||
)
|
||||
c.ldapSearchTime = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "ldap_search_time_sec"),
|
||||
"Time (sec) to send an LDAP search request and receive a response",
|
||||
[]string{"name"},
|
||||
nil,
|
||||
)
|
||||
c.ldapSearchOperations = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "ldap_search_operations_total"),
|
||||
"Total number of LDAP search operations",
|
||||
[]string{"name"},
|
||||
nil,
|
||||
)
|
||||
c.ldapWriteTime = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "ldap_write_time_sec"),
|
||||
"Time (sec) to send an LDAP Add/Modify/Delete request and receive a response",
|
||||
[]string{"name"},
|
||||
nil,
|
||||
)
|
||||
c.ldapWriteOperations = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "ldap_write_operations_total"),
|
||||
"Total number of LDAP Add/Modify/Delete operations",
|
||||
[]string{"name"},
|
||||
nil,
|
||||
)
|
||||
c.ldapTimeoutErrorsPerSec = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "ldap_timeout_errors_total"),
|
||||
"Total number of LDAP timeout errors",
|
||||
@@ -114,6 +138,13 @@ func (c *Collector) collectADAccessProcesses(ch chan<- prometheus.Metric) error
|
||||
labelName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ldapReadOperations,
|
||||
prometheus.CounterValue,
|
||||
data.LdapReadOperationsTotal,
|
||||
labelName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ldapSearchTime,
|
||||
prometheus.CounterValue,
|
||||
@@ -121,6 +152,13 @@ func (c *Collector) collectADAccessProcesses(ch chan<- prometheus.Metric) error
|
||||
labelName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ldapSearchOperations,
|
||||
prometheus.CounterValue,
|
||||
data.LdapSearchOperationsTotal,
|
||||
labelName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ldapWriteTime,
|
||||
prometheus.CounterValue,
|
||||
@@ -128,6 +166,13 @@ func (c *Collector) collectADAccessProcesses(ch chan<- prometheus.Metric) error
|
||||
labelName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ldapWriteOperations,
|
||||
prometheus.CounterValue,
|
||||
data.LdapWriteOperationsTotal,
|
||||
labelName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ldapTimeoutErrorsPerSec,
|
||||
prometheus.CounterValue,
|
||||
|
||||
Reference in New Issue
Block a user