add some logging
This commit is contained in:
parent
f5a2ecd6fd
commit
b080318748
1 changed files with 3 additions and 0 deletions
|
|
@ -88,10 +88,12 @@ def tailscale_labels(tailnet, device, tag) -> Dict[str, str]:
|
||||||
|
|
||||||
|
|
||||||
async def matrix_node_sd(device) -> Dict:
|
async def matrix_node_sd(device) -> Dict:
|
||||||
|
log.info("Polling matrix node", extra={"props": {"hostname": device["hostname"]}})
|
||||||
ipv4 = ipv4_only(device["addresses"])[0]
|
ipv4 = ipv4_only(device["addresses"])[0]
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
r = await client.get(f"http://{ipv4}:8081/")
|
r = await client.get(f"http://{ipv4}:8081/")
|
||||||
data = r.json()
|
data = r.json()
|
||||||
|
log.debug(f"Found {len(data)} workers", extra={"hostname": device["hostname"]})
|
||||||
return group_by_type(data)
|
return group_by_type(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -138,6 +140,7 @@ async def matrix_sd(tailnet, devices) -> List:
|
||||||
targets = matrix_workers_to_sd(tailnet, device, workers)
|
targets = matrix_workers_to_sd(tailnet, device, workers)
|
||||||
if targets:
|
if targets:
|
||||||
sd.append(targets)
|
sd.append(targets)
|
||||||
|
log.info(f"Found {len(sd)} matrix servcies")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue