logon: deprecate collector. Use terminal_services instead (#1957)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2025-04-04 20:20:08 +02:00
committed by GitHub
parent fa8af098c8
commit 0846c2805f
6 changed files with 15 additions and 87 deletions

View File

@@ -53,7 +53,7 @@ type Collector struct {
processesLimit *prometheus.Desc
// users
// Deprecated: Use count(windows_logon_logon_type) instead.
// Deprecated: Use `sum(windows_terminal_services_session_info{state="active"})` instead.
users *prometheus.Desc
// physicalMemoryFreeBytes
@@ -106,7 +106,7 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
logger.Warn("The os collect holds a number of deprecated metrics and will be removed mid 2025. "+
logger.Warn("The os collector holds a number of deprecated metrics and will be removed mid 2025. "+
"See https://github.com/prometheus-community/windows_exporter/pull/1596 for more information.",
slog.String("collector", Name),
)
@@ -180,7 +180,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
)
c.users = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "users"),
"Deprecated: Use `count(windows_logon_logon_type)` instead.",
"Deprecated: Use `sum(windows_terminal_services_session_info{state=\"active\"})` instead.",
nil,
nil,
)