Skip to content

Commit

Permalink
controller/metrics/metrics.go: report metrics for only at least 1 hou…
Browse files Browse the repository at this point in the history
…r elapsed time and 1 install restarts

track clusters in hive_cluster_deployment_provision_underway_seconds which have been provisioning for atleast
1 hour.
track clusters in hive_cluster_deployment_provision_underway_install_restarts which have atleast 1 restarts.

This makes sure the amount of metrics collected are smaller but still provide most value in alerting failed installs.
  • Loading branch information
abhinavdahiya committed Feb 8, 2021
1 parent bc6636f commit dd28eaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ func Add(mgr manager.Manager) error {
Client: mgr.GetClient(),
Interval: 2 * time.Minute,
}
metrics.Registry.MustRegister(newProvisioningUnderwayCollector(mgr.GetClient()))
metrics.Registry.MustRegister(newProvisioningUnderwaySecondsCollector(mgr.GetClient(), 1*time.Hour))
metrics.Registry.MustRegister(newProvisioningUnderwayInstallRestartsCollector(mgr.GetClient(), 1))
err := mgr.Add(mc)
if err != nil {
return err
Expand Down

0 comments on commit dd28eaf

Please sign in to comment.