Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions windows_service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ Beginning with Agent version 7.73, the check automatically adds a `windows_servi

See [metadata.csv][19] for a list of metrics provided by this integration.

**Note:** Metrics are tagged with the same tags as the service check.

### Events

The Windows Service check does not include any events.
Expand Down
1 change: 1 addition & 0 deletions windows_service/changelog.d/21830.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add state metric to windows services
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ def check(self, instance):
self.service_check(self.SERVICE_CHECK_NAME, status, tags=tags)
self.log.debug('service state for %s %s', service_name, status)
self.gauge('windows_service.uptime', service_uptime, tags=tags)
# Send 1 for windows_service.state so the user can sum by the windows_service_state tag
# to filter services by state. e.g. sum:windows_service.state{*} by windows_service_state
self.gauge('windows_service.state', 1, tags=tags)

if 'ALL' not in services:
for service in services_unseen:
Expand All @@ -365,3 +368,5 @@ def check(self, instance):

self.service_check(self.SERVICE_CHECK_NAME, status, tags=tags)
self.log.debug('service state for %s %s', service, status)
self.gauge('windows_service.uptime', 0, tags=tags)
self.gauge('windows_service.state', 1, tags=tags)
3 changes: 2 additions & 1 deletion windows_service/metadata.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric,sample_tags
windows_service.uptime,gauge,,second,,The uptime (in seconds) of the host process of the Windows service,0,windows_service,uptime,,
windows_service.state,gauge,,service,,Sum by state to count the number of services in each state,0,windows_service,state,,
windows_service.uptime,gauge,,second,,The uptime (in seconds) of the host process of the Windows service,0,windows_service,uptime,,
Loading
Loading