We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c4c79a commit aa26b79Copy full SHA for aa26b79
tcp_check/changelog.d/17912.added
@@ -0,0 +1 @@
1
+[tcp_checks] If dns-resolve failed don't report metrics.
tcp_check/datadog_checks/tcp_check/tcp_check.py
@@ -116,8 +116,13 @@ def check(self, _):
116
start = get_precise_time() # Avoid initialisation warning
117
118
if self.should_resolve_ips():
119
- self.resolve_ips()
120
- self.ip_cache_last_ts = start
+ try:
+ self.resolve_ips()
121
+ self.ip_cache_last_ts = start
122
+ except CheckException as e:
123
+ self.log.error("DNS resolution failed: %s", str(e))
124
+ self.report_as_service_check(AgentCheck.CRITICAL, "DNS resolution failed", str(e))
125
+ return # The dns-resolve failed
126
127
self.log.debug("Connecting to %s on port %d", self.host, self.port)
128
0 commit comments