-
Notifications
You must be signed in to change notification settings - Fork 187
feat(tenant): expose additional metrics #1517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Hristo Hristov <me@hhristov.info>
Signed-off-by: Hristo Hristov <me@hhristov.info>
95056cd
to
625483e
Compare
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>
@oliverbaehler I did refactor the approach. LMK WYT |
controllers/tenant/metrics.go
Outdated
r.Metrics.DeleteTenantStatusMetrics(tenant.GetName()) | ||
// Expose namespace-tenant relationship | ||
for _, ns := range tenant.Status.Namespaces { | ||
r.Metrics.TenantNamespaceRelationshipGauge.WithLabelValues(tenant.GetName(), ns).Set(1) | ||
} |
There was a problem hiding this comment.
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
controllers/tenant/manager.go
Outdated
// Ensuring Status metrics are exposed | ||
r.Log.Info("Ensuring all status metrics are exposed") | ||
r.syncStatusMetrics(instance) |
There was a problem hiding this comment.
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>
resolves #1516