Fix container resource sampling and surface collection failures
This commit is contained in:
@@ -32,7 +32,7 @@ import urllib.parse
|
||||
import urllib.request
|
||||
import uuid
|
||||
|
||||
VERSION = "1.4.5"
|
||||
VERSION = "1.4.6"
|
||||
LABEL = "io.electric-cherry"
|
||||
MAX_FILE = 32 * 1024 * 1024
|
||||
LIBRARY_DOWNLOAD_WORKERS = 4
|
||||
@@ -933,7 +933,7 @@ class Agent:
|
||||
|
||||
def instance_resources(self):
|
||||
"""One bounded Docker stats batch; unavailable samples are never zero load."""
|
||||
ids = self.docker.call("container", "ls", "--filter", LABEL + ".managed=true",
|
||||
ids = self.docker.call("container", "ls", "--filter", "label=" + LABEL + ".managed=true",
|
||||
"--no-trunc", "--format", "{{.ID}}", timeout=10).splitlines()[:1000]
|
||||
if not ids:
|
||||
return []
|
||||
@@ -1084,8 +1084,10 @@ class Agent:
|
||||
images.extend(alias for alias, image_id in json.loads(aliases.read_text()).items() if image_id in image_ids)
|
||||
resources = {}
|
||||
if docker_running:
|
||||
with contextlib.suppress(AgentError, ValueError, TypeError, KeyError):
|
||||
try:
|
||||
resources["instanceResources"] = self.instance_resources()
|
||||
except (AgentError, ValueError, TypeError, KeyError):
|
||||
resources["instanceResourcesError"] = "Container resource sampling failed. Check Docker access and stats availability on this host."
|
||||
os_name = platform.system()
|
||||
with contextlib.suppress(OSError):
|
||||
for line in Path("/etc/os-release").read_text().splitlines():
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"version": "1.4.5",
|
||||
"version": "1.4.6",
|
||||
"protocolVersion": 1,
|
||||
"platform": "debian-amd64",
|
||||
"sha256": "bd4afa2ec3ab6a3022dba99d0580b4b6b1ba5622ae4138035e3e3862885a97bd",
|
||||
"sha256": "bdedda91475bd29c2140bf32932a1dfc358e7069736439b036ffb333b4300cc3",
|
||||
"updaterProtocolVersion": 1,
|
||||
"updaterSha256": "066bb896726600ece9ce72697ce523c9a707cc9a621505931ba0892dec59d3c8"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user