Skip to content

Conversation

@christophrj
Copy link
Contributor

@christophrj christophrj commented Oct 1, 2025

What this PR does / why we need it:

This PR fixes GVK filtering for ManagedMetrics.

Additionally this PR fixes that the GVK metric attributes are based on the custom resource instead of ManagedMetric.Spec.

This PR also slightly changed the filtering of CRDs beyond GVK: I dropped the storedVersion condition as I don't see why a servable API should be filtered out just because it was never marked as a stored version.

Which issue(s) this PR fixes:
Fixes #47

Special notes for your reviewer:

I encoutered a couple of unrelated issues when testing my changes:

  1. ManagedMetric Value: while the metric reports the correct number of targeted resources inside the cluster, the current attribute set will result in inaccurate values in the datasink (e.g. dynatrace/prometheus/etc)
  2. Metric Attributes are not consistent across different metric types: e.g. Metrics add kind with key "resource", while ManagedMetrics adds kind with key "kind". Metrics report GVK based on Metric.Spec instead of the actual resource (similar to the bug addressed with this PR).

I will create two follow-up issues to address both points.

Release note:

ManagedMetric filtering based on provided GVK spec

@christophrj christophrj force-pushed the fix/managed-metric-gvk-filtering branch from 9357c46 to d87b0d1 Compare October 1, 2025 10:20
On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
@christophrj christophrj force-pushed the fix/managed-metric-gvk-filtering branch from d87b0d1 to 611aba8 Compare October 1, 2025 10:27
On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
@christophrj christophrj force-pushed the fix/managed-metric-gvk-filtering branch from 51e898e to c9f307f Compare October 2, 2025 10:05
Copy link
Member

@maximiliantech maximiliantech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @christophrj 🚀

@christophrj christophrj merged commit 4ee369e into openmcp-project:main Oct 2, 2025
4 checks passed
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.

ManagedMetric Not Filtering by kind/group/version

2 participants