fix collectServerSession func

Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
This commit is contained in:
Andrey Burtasov 2023-11-24 17:57:31 +03:00
parent 8f177f03c3
commit 61ec692534
1 changed files with 5 additions and 0 deletions

View File

@ -183,6 +183,7 @@ func (c *collector) collectServerShares(ctx *types.ScrapeContext, ch chan<- prom
// Perflib: SMB Server Sessions
type perflibServerSession struct {
Name string
TreeConnectCount float64 `perflib:"Tree Connect Count"`
}
@ -193,6 +194,10 @@ func (c *collector) collectServerSessions(ctx *types.ScrapeContext, ch chan<- pr
}
for _, instance := range data {
labelName := c.toLabelName(instance.Name)
if !strings.HasSuffix(labelName, "_total") {
continue
}
ch <- prometheus.MustNewConstMetric(
c.TreeConnectCount,