Skip to content

Conversation

Svarrogh1337
Copy link
Collaborator

resolves #1516

@Svarrogh1337 Svarrogh1337 marked this pull request as draft June 25, 2025 17:22
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
@Svarrogh1337 Svarrogh1337 marked this pull request as ready for review July 4, 2025 09:04
Signed-off-by: Hristo Hristov <me@hhristov.info>
@Svarrogh1337
Copy link
Collaborator Author

@oliverbaehler I did refactor the approach. LMK WYT

Comment on lines 11 to 15
r.Metrics.DeleteTenantStatusMetrics(tenant.GetName())
// Expose namespace-tenant relationship
for _, ns := range tenant.Status.Namespaces {
r.Metrics.TenantNamespaceRelationshipGauge.WithLabelValues(tenant.GetName(), ns).Set(1)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you think of a smoother implementation than always deleting all of the exemplers? Even if so, DeletePartialMatch is very resource intensive. We should avoid doing that on every loop for scalability. However you might be able to preserve the status namespaces before reconciling and diffing between the namespaces and remove those, which are no longer in the status

Comment on lines 94 to 96
// Ensuring Status metrics are exposed
r.Log.Info("Ensuring all status metrics are exposed")
r.syncStatusMetrics(instance)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this before the loop? This wont be an accurate representation?

Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
# Conflicts:
#	controllers/tenant/manager.go
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
@oliverbaehler oliverbaehler merged commit e234200 into projectcapsule:main Aug 1, 2025
14 checks passed
@Svarrogh1337 Svarrogh1337 deleted the feat/metrics branch August 2, 2025 04:03
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.

Add additional metrics for Tenant
2 participants