influxdata / influxdata/telegraf

Expose trigger status for Windows services with on demand start

Open
#4,408 6 comments 0 reactions 0 assignees View on GitHub
feature request help wanted platform/windows
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

## Feature Request

Windows services may be configured with a trigger that stops inactive services and restart them on demand when requested. These services are shown in Windows as `(Trigger Start)` after the startup mode. One such example is the service `DNS Client (Dnscache)`.

### Proposal:

In the Telegraf plugin win_services it would be good to add trigger info as either

a tag with the name `triggered` on the existing `startup_mode` metric (preferred).
or
a new metric `triggered` with value 0 (no trigger) or 1 (has trigger) in addition to `state` and `startup_mode`. Include the same tags as on `startup_mode` (`display_name` and `service_name`)

See https://mikefrobbins.com/2015/12/24/use-powershell-to-determine-services-with-a-starttype-of-automatic-or-manual-with-trigger-start/ and https://docs.microsoft.com/en-us/windows/desktop/services/service-trigger-events

### Current behavior:

Currently only metrics for `state` and `startup_mode` are returned, none shows info if the service is configured with trigger info.

### Desired behavior:

A way to see if a service is configured as `Manual (Trigger Start)` or `Automatic (Trigger Start)` and distinguish that from "normal" `Manual` and `Automatic` startup mode.

### Use case: [Why is this important (helps with prioritizing requests)]

When the metrics `startup_mode` and `state` are combined it is possible to alert on all services that should be started actually are started without having to list each service being monitored. This works well for services with startup mode `Automatic`.
It also works for services in startup mode `Automatic (Trigger Start)` if they are not stopped by Windows awaiting on-demand start. Monitoring these services gives false alarms since they are in state stopped and startup mode automatic. It would be good to be able to filter these kind of services out (and possibly monitor them in other ways).

Contributor guide

Open the contributing guide

Research direction

Start in the Telegraf win_services plugin and trace how the existing state and startup_mode metrics obtain Windows service information. Implement the requested trigger distinction using the proposed startup_mode tag or a separate metric, preserving display_name and service_name, and verify that Manual and Automatic services can be distinguished from their trigger-start variants.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.