File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9494 },
9595 []string {"operation" , "success" },
9696 )
97+ AutogrowPolicyGauge = promauto .NewGauge (
98+ prometheus.GaugeOpts {
99+ Namespace : config .OrchestratorName ,
100+ Name : "autogrow_policy_count" ,
101+ Help : "The total number of Autogrow policies" ,
102+ },
103+ )
104+ AutogrowVolumes = promauto .NewGaugeVec (
105+ prometheus.GaugeOpts {
106+ Namespace : config .OrchestratorName ,
107+ Name : "autogrow_volume_count" ,
108+ Help : "The total number of volumes on which Autogrow is enabled" ,
109+ },
110+ []string {"autogrow_policy" , "storage_class" },
111+ )
97112)
Original file line number Diff line number Diff line change @@ -769,6 +769,32 @@ func (o *TridentOrchestrator) updateMetrics() {
769769 }
770770 }
771771 }
772+
773+ metrics .AutogrowPolicyGauge .Set (float64 (len (o .autogrowPolicies )))
774+
775+ metrics .AutogrowVolumes .Reset ()
776+ for _ , volume := range o .volumes {
777+ if volume == nil {
778+ continue
779+ }
780+ if volume .EffectiveAGPolicy .PolicyName != "" {
781+ metrics .AutogrowVolumes .WithLabelValues (
782+ volume .EffectiveAGPolicy .PolicyName ,
783+ volume .Config .StorageClass ,
784+ ).Inc ()
785+ }
786+ }
787+ for _ , volume := range o .subordinateVolumes {
788+ if volume == nil {
789+ continue
790+ }
791+ if volume .EffectiveAGPolicy .PolicyName != "" {
792+ metrics .AutogrowVolumes .WithLabelValues (
793+ volume .EffectiveAGPolicy .PolicyName ,
794+ volume .Config .StorageClass ,
795+ ).Inc ()
796+ }
797+ }
772798}
773799
774800func (o * TridentOrchestrator ) handleFailedTransaction (ctx context.Context , v * storage.VolumeTransaction ) error {
You can’t perform that action at this time.
0 commit comments