Skip to content
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

Fix openmetrics v2 service check: there shouldn’t be any host #13146

Merged
merged 8 commits into from
Oct 27, 2022
Merged
5 changes: 4 additions & 1 deletion datadog_checks_base/datadog_checks/base/checks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ def __init__(self, *args, **kwargs):
self.debug_metrics.update(self.instance.get('debug_metrics', {}))

# `self.hostname` is deprecated, use `datadog_agent.get_hostname()` instead
self.hostname = datadog_agent.get_hostname() # type: str
if self.instance is not None and self.instance.get('empty_default_hostname', False):
self.hostname = ""
else:
self.hostname = datadog_agent.get_hostname() # type: str

logger = logging.getLogger('{}.{}'.format(__name__, self.name))
self.log = CheckLoggingAdapter(logger, self)
Expand Down