terminal_services: Avoid duplicate metrics by add session_id (#1576)
This commit is contained in:
parent
2589e56f95
commit
56709b9638
|
@ -5,6 +5,7 @@ package terminal_services
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
@ -123,7 +124,7 @@ func (c *Collector) Build() error {
|
||||||
c.sessionInfo = prometheus.NewDesc(
|
c.sessionInfo = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "session_info"),
|
prometheus.BuildFQName(types.Namespace, Name, "session_info"),
|
||||||
"Terminal Services sessions info",
|
"Terminal Services sessions info",
|
||||||
[]string{"session_name", "user", "host", "state"},
|
[]string{"session_name", "user", "host", "state", "id"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
c.connectionBrokerPerformance = prometheus.NewDesc(
|
c.connectionBrokerPerformance = prometheus.NewDesc(
|
||||||
|
@ -445,6 +446,7 @@ func (c *Collector) collectWTSSessions(ch chan<- prometheus.Metric) error {
|
||||||
userName,
|
userName,
|
||||||
session.HostName,
|
session.HostName,
|
||||||
stateName,
|
stateName,
|
||||||
|
strconv.Itoa(int(session.SessionID)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue