-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional display_name tag #17657
Conversation
- name: collect_display_name_as_tag | ||
description: | | ||
Whether or not to submit the Windows Service Display Name as the `display_name` tag. | ||
`display_name` will be formatted according to Datadog's tagging requirements: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English my second language of course but do you think we can restate it a bit differently for clarity, e.g. Windows Service Display name will be automatically formatted according to Datadog's tagging requirements (https://docs.datadoghq.com/getting_started/tagging/#define-tags) as display_name
tag value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it worth to describe auto-formatting rules.
windows_service/datadog_checks/windows_service/windows_service.py
Outdated
Show resolved
Hide resolved
@@ -314,6 +318,9 @@ def check(self, instance): | |||
if instance.get('windows_service_startup_type_tag', False): | |||
tags.append('windows_service_startup_type:{}'.format(startup_type_string)) | |||
|
|||
if instance.get('collect_display_name_as_tag', False): | |||
tags.append('display_name:{}'.format(display_name)) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking to replace
if 'ALL' not in services:
for service in services_unseen:
# if a name doesn't match anything (wrong name or no permission to access the service), report UNKNOWN
status = self.UNKNOWN
startup_type_string = ServiceView.STARTUP_TYPE_UNKNOWN
display_name = "Not_Found"
tags = ['windows_service:{}'.format(service)]
tags.extend(custom_tags)
if instance.get('windows_service_startup_type_tag', False):
tags.append('windows_service_startup_type:{}'.format(startup_type_string))
if instance.get('collect_display_name_as_tag', False):
tags.append('display_name:{}'.format(display_name))
on something like
if 'ALL' not in services:
for service in services_unseen:
# if a name doesn't match anything (wrong name or no permission to access the service), report UNKNOWN
status = self.UNKNOWN
tags = ['windows_service:{}'.format(service)]
tags.extend(custom_tags)
if instance.get('windows_service_startup_type_tag', False):
tags.append('windows_service_startup_type:{}'.format(ServiceView.STARTUP_TYPE_UNKNOWN))
if instance.get('collect_display_name_as_tag', False):
tags.append('display_name:{}'.format(ServiceView.DISPLAY_NAME_UNKNOWN))
What does this PR do?
Add a new tag to each windows_service service check that includes the Windows Service Display Name as the tag
display_name
.Add a
collect_display_name_as_tag
option to control presence/absence of the tag.Motivation
Customer Requests: https://datadoghq.atlassian.net/browse/WINA-795
Additional Notes
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged