Skip to content

Consistent GVK attribute export across all metric types #93

@christophrj

Description

@christophrj

What would you like to be added:

Right now metric attributes are not consistently exported in terms of their GVK attributes which is confusing to end users and also a potential source for errors.

Metrics and FederatedMetrics export GVK attributes based on the spec.target fields and kind as "resource": https://github.com/openmcp-project/metrics-operator/blob/main/internal/orchestrator/metrichandler.go#L135

ManagedMetrics and FederatedManagedMetrics export GVK attributes based on the observed resource and kind as "kind": https://github.com/openmcp-project/metrics-operator/blob/main/internal/orchestrator/managedhandler.go#L62

This issue requires further alignment but as a starting point I suggest the following 2 options:
(A) all metrics export GVK attributes based on the spec.target fields kind as "kind" -> simple and 1 to 1 mapping between "cluster" and "datasink" metric. downside is obviously the missing granularity of the observed CustomeResources
(B) A plus GVK values of CustomResources where both are explicitly labeled as Target GVK and CR GVK -> more complex but enables detailed view of the underlying metrics CRs in the DataSink.

Why is this needed:
To implement consistent behavior across all metric types and prevent bugs based on those inconsistencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/providerAll Provider related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions