Azure / azure-container-networking

Azure Container Networking Solutions for Linux and Windows Containers
MIT License
376 stars 240 forks source link

fix: make ipamv2 metrics resilient to missing custom resource definitions #3029

Closed rbtr closed 3 days ago

rbtr commented 1 week ago

Reason for Change:

The metrics observer added in #2970 fails fast if a source of metrics is unavailable. This prevents legacy metrics from being collected at all in scenarios like (as occurred) the ClusterSubnetState custom resource definition is not installed in the cluster.

In this change, the observer is made resilient to missing data sources or errors in the data collection, and will make a best-effort attempt to record the metrics even in case of partial data availability.

Issue Fixed:

Requirements:

Notes:

rbtr commented 1 week ago

/azp run Azure Container Networking PR

azure-pipelines[bot] commented 1 week ago
Azure Pipelines successfully started running 1 pipeline(s).
nddq commented 3 days ago

lgtm, although this behavior (potentially missing data sources/ errors that affects the metrics) is unique to ipam v2 right?

rbtr commented 3 days ago

yes, due to how ipamv2 pulls the CRs directly (since it doesn't already have them, like ipamv1 did)