add some logging

This commit is contained in:
Abel Luck 2023-11-06 11:45:48 +01:00
parent f5a2ecd6fd
commit b080318748

View file

@ -88,10 +88,12 @@ def tailscale_labels(tailnet, device, tag) -> Dict[str, str]:
async def matrix_node_sd(device) -> Dict:
log.info("Polling matrix node", extra={"props": {"hostname": device["hostname"]}})
ipv4 = ipv4_only(device["addresses"])[0]
async with httpx.AsyncClient() as client:
r = await client.get(f"http://{ipv4}:8081/")
data = r.json()
log.debug(f"Found {len(data)} workers", extra={"hostname": device["hostname"]})
return group_by_type(data)
@ -138,6 +140,7 @@ async def matrix_sd(tailnet, devices) -> List:
targets = matrix_workers_to_sd(tailnet, device, workers)
if targets:
sd.append(targets)
log.info(f"Found {len(sd)} matrix servcies")
return []