github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/metrics/metrics.go (about) 1 package metrics 2 3 import ( 4 "github.com/kyma-project/kyma-environment-broker/internal/event" 5 "github.com/kyma-project/kyma-environment-broker/internal/process" 6 "github.com/prometheus/client_golang/prometheus" 7 ) 8 9 func RegisterAll(sub event.Subscriber, operationStatsGetter OperationsStatsGetter, instanceStatsGetter InstancesStatsGetter) { 10 opResultCollector := NewOperationResultCollector() 11 opDurationCollector := NewOperationDurationCollector() 12 stepResultCollector := NewStepResultCollector() 13 prometheus.MustRegister(opResultCollector, opDurationCollector, stepResultCollector) 14 prometheus.MustRegister(NewOperationsCollector(operationStatsGetter)) 15 prometheus.MustRegister(NewInstancesCollector(instanceStatsGetter)) 16 17 sub.Subscribe(process.ProvisioningStepProcessed{}, opResultCollector.OnProvisioningStepProcessed) 18 sub.Subscribe(process.DeprovisioningStepProcessed{}, opResultCollector.OnDeprovisioningStepProcessed) 19 sub.Subscribe(process.UpgradeKymaStepProcessed{}, opResultCollector.OnUpgradeKymaStepProcessed) 20 sub.Subscribe(process.UpgradeClusterStepProcessed{}, opResultCollector.OnUpgradeClusterStepProcessed) 21 sub.Subscribe(process.ProvisioningSucceeded{}, opResultCollector.OnProvisioningSucceeded) 22 sub.Subscribe(process.ProvisioningSucceeded{}, opDurationCollector.OnProvisioningSucceeded) 23 sub.Subscribe(process.DeprovisioningStepProcessed{}, opDurationCollector.OnDeprovisioningStepProcessed) 24 sub.Subscribe(process.ProvisioningStepProcessed{}, stepResultCollector.OnProvisioningStepProcessed) 25 sub.Subscribe(process.DeprovisioningStepProcessed{}, stepResultCollector.OnDeprovisioningStepProcessed) 26 sub.Subscribe(process.OperationStepProcessed{}, stepResultCollector.OnOperationStepProcessed) 27 sub.Subscribe(process.OperationStepProcessed{}, opResultCollector.OnOperationStepProcessed) 28 sub.Subscribe(process.OperationSucceeded{}, opResultCollector.OnOperationSucceeded) 29 sub.Subscribe(process.OperationSucceeded{}, opDurationCollector.OnOperationSucceeded) 30 sub.Subscribe(process.OperationStepProcessed{}, opDurationCollector.OnOperationStepProcessed) 31 }