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

@@ -34,6 +34,7 @@ type Config struct{}
var ConfigDefaults = Config{}
// A Collector is a Prometheus Collector for WMI metrics.
// Deprecated: Use windows_terminal_services_session_info instead.
type Collector struct {
config Config
@@ -64,10 +65,16 @@ func (c *Collector) Close() error {
return nil
}
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
logger.Warn("The logon collector will be removed mid 2025. "+
"See https://github.com/prometheus-community/windows_exporter/pull/1957 for more information. If you see values in this collector"+
" that you need, please open an issue to discuss how to get them into the new collector.",
slog.String("collector", Name),
)
c.sessionInfo = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "session_logon_timestamp_seconds"),
"timestamp of the logon session in seconds.",
"Deprecated. Use windows_terminal_services_session_info instead.",
[]string{"id", "username", "domain", "type"},
nil,
)