Skip to content

Track all status conditions per resource, not just one#571

Draft
scotwells wants to merge 2 commits intomainfrom
feat/resource-metrics-policy-conversion
Draft

Track all status conditions per resource, not just one#571
scotwells wants to merge 2 commits intomainfrom
feat/resource-metrics-policy-conversion

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

@scotwells scotwells commented Apr 19, 2026

What this does

Replaces the custom metrics sidecar with a ResourceMetricsPolicy that instructs the resource-metrics operator to collect and export metrics for Milo's core resources (IAM, resource manager, quota).

Each resource now emits:

  • An info series with identity and creation timestamp
  • A status condition series for every condition on the resource — not just hardcoded ones like Ready

Previously the sidecar only tracked specific named conditions. With the new policy any condition the API server sets on a resource is automatically captured, so new condition types appear in dashboards and alerts without any config changes.

Test plan

  • Deploy to a dev environment and confirm metrics appear in Victoria Metrics for IAM, resource manager, and quota resources
  • Verify that all condition types (not just Ready) show up as separate series per resource

🤖 Generated with Claude Code

Converts CustomResourceStateMetrics ConfigMap configs to ResourceMetricsPolicy
CRD objects for the new resource-metrics operator.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@joggrbot

This comment has been minimized.

Replace verbose per-condition CEL filter/exists logic with the new
forEach field on metric specs. Each status-condition generator now
iterates object.status.conditions once and emits one series per
element via item.*, rather than hardcoding individual condition types.

The quota-grant-creation-policy generator previously had two separate
metrics (Ready + ParentContextReady); these are collapsed into a single
forEach metric.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scotwells scotwells changed the title feat: convert resource metrics to ResourceMetricsPolicy Track all status conditions per resource, not just one Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant