feat: add agentmon services section to infrastructure page
Label all agentmon docker-compose services with agentmon.monitor=true and agentmon.group=agentmon so the swarm-monitor picks them up. Adds Group field to ServiceSnapshot, probes /healthz for api/web roles, and renders a separate "Agentmon" section below Swarm Services on the Infrastructure page with new api and worker card renderers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,7 @@ func collectOne(ctx context.Context, c dockerContainer, dockerClient, httpClient
|
||||
name := containerName(c)
|
||||
snap := ServiceSnapshot{
|
||||
Name: name,
|
||||
Group: c.Labels["agentmon.group"],
|
||||
Role: c.Labels["agentmon.role"],
|
||||
ContainerState: c.State,
|
||||
HealthState: "none",
|
||||
@@ -121,6 +122,10 @@ func collectOne(ctx context.Context, c dockerContainer, dockerClient, httpClient
|
||||
collectHTTPProbe(ctx, &snap, httpClient, "http://localhost:"+port+"/")
|
||||
case "mcp":
|
||||
collectPortProbe(&snap, port)
|
||||
case "api", "web":
|
||||
if port != "" {
|
||||
collectHTTPProbe(ctx, &snap, httpClient, "http://localhost:"+port+"/healthz")
|
||||
}
|
||||
}
|
||||
|
||||
snap.Status = deriveStatus(snap)
|
||||
|
||||
@@ -5,6 +5,7 @@ import "time"
|
||||
// ServiceSnapshot holds the collected state for one docker-compose service.
|
||||
type ServiceSnapshot struct {
|
||||
Name string `json:"name"`
|
||||
Group string `json:"group,omitempty"`
|
||||
Role string `json:"role"`
|
||||
ContainerState string `json:"container_state"` // running/stopped/exited/missing
|
||||
HealthState string `json:"health_state"` // healthy/unhealthy/starting/none
|
||||
|
||||
Reference in New Issue
Block a user