A new milestone for my V2 Capacity Advisor: it now receives Azure Monitor alerts through a real webhook!
The flow is now:
Azure Monitor → Traefik ingress in AKS → authenticated webhook → Capacity Advisor → Table Storage + metric analysis → Cloudflare AI → LLM advice
The webhook receives the alert, extracts the relevant workload and resource information, and stores the alert history in Azure Table Storage. This gives the advisor historical context instead of forcing it to evaluate every alert in isolation.
The LLM advice now considers:
- Previous alerts for the workload.
- Whether the issue appears to be a one-time event or a recurring trend.
- Current CPU and memory usage.
- Configured requests and limits.
- Available capacity on existing AKS nodes.
- Projected resource saturation after placement.
- Current node and cluster overcommit.
The deterministic analysis makes the actual capacity and placement decision. The LLM then turns that result into a more thorough explanation and an operator-friendly recommendation.
The development journey included more battles than expected:
- Getting the webhook reliably through Traefik into AKS.
- Working through HTTPS termination and forwarded headers.
- Handling JWT authentication and missing scope/roles claims.
- Supporting different Azure Monitor alert payload shapes.
- Distinguishing Fired and Resolved alert events.
- Making sure alert history is stored and updated correctly in Table Storage.
- Understanding why Cloudflare LLM response was truncated.
Each issue exposed another boundary in the system. That was frustrating at times, but also useful: the advisor is now being tested as an actual distributed system rather than just a local prototype.
The result is a more complete capacity recommendation: not only "memory usage is high", but also whether the workload fits on an existing node, what capacity remains, whether the issue is recurring, and what action an operator should take.
