Skip to content

Commit

Permalink
the collect metadata in check.py has to check for the collect_server_…
Browse files Browse the repository at this point in the history
…info before attempting to collect server info, even when the base url is well formated
  • Loading branch information
HadhemiDD committed Jun 13, 2023
1 parent ff2ef14 commit be33e36
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions envoy/datadog_checks/envoy/envoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,9 @@ def _collect_metadata(self):
if not self.collect_server_info:
self.log.debug("Skipping server info collection because collect_server_info was disabled")
return
raw_version = None
# From http://domain/thing/stats to http://domain/thing/server_info
if self.collect_server_info:
server_info_url = urljoin(self.stats_url, 'server_info')
raw_version = _get_server_info(server_info_url, self.log, self.http)
server_info_url = urljoin(self.stats_url, 'server_info')
raw_version = _get_server_info(server_info_url, self.log, self.http)

if raw_version:
self.set_metadata('version', raw_version)

0 comments on commit be33e36

Please sign in to comment.