Skip to content

Commit

Permalink
Fix openmetrics v2 service check: there shouldn’t be any host
Browse files Browse the repository at this point in the history
  • Loading branch information
L3n41c committed Oct 17, 2022
1 parent a821606 commit 2b00612
Showing 1 changed file with 4 additions and 1 deletion.
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.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

0 comments on commit 2b00612

Please sign in to comment.