Add new counter

Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
This commit is contained in:
Mark Dordoy 2023-08-30 14:36:47 +01:00
parent f7426e9fad
commit d78230f67b
No known key found for this signature in database
GPG Key ID: F88D4B15B0F3A907
1 changed files with 12 additions and 0 deletions

View File

@ -59,6 +59,7 @@ type ADCollector struct {
LdapSearchesTotal *prometheus.Desc
LdapUdpOperationsTotal *prometheus.Desc
LdapWritesTotal *prometheus.Desc
LdapClientSessions *Prometheus.Desc
LinkValuesCleanedTotal *prometheus.Desc
PhantomObjectsCleanedTotal *prometheus.Desc
PhantomObjectsVisitedTotal *prometheus.Desc
@ -343,6 +344,12 @@ func newADCollector(logger log.Logger) (Collector, error) {
nil,
nil,
),
LdapClientSessions: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "client_sessions"),
"",
nil,
nil,
),
LinkValuesCleanedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "link_values_cleaned_total"),
"",
@ -1190,6 +1197,11 @@ func (c *ADCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, er
prometheus.CounterValue,
float64(dst[0].LDAPWritesPersec),
)
ch <- prometheus.MustNewConstMetric(
c.LdapClientSessions,
prometheus.CounterValue,
float64(dst[0].LDAPClientSessions),
)
ch <- prometheus.MustNewConstMetric(
c.LinkValuesCleanedTotal,