File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed 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 @@ -772,6 +772,32 @@ func (o *TridentOrchestrator) updateMetrics() {
772772 }
773773 }
774774 }
775+
776+ metrics .AutogrowPolicyGauge .Set (float64 (len (o .autogrowPolicies )))
777+
778+ metrics .AutogrowVolumes .Reset ()
779+ for _ , volume := range o .volumes {
780+ if volume == nil {
781+ continue
782+ }
783+ if volume .EffectiveAGPolicy .PolicyName != "" {
784+ metrics .AutogrowVolumes .WithLabelValues (
785+ volume .EffectiveAGPolicy .PolicyName ,
786+ volume .Config .StorageClass ,
787+ ).Inc ()
788+ }
789+ }
790+ for _ , volume := range o .subordinateVolumes {
791+ if volume == nil {
792+ continue
793+ }
794+ if volume .EffectiveAGPolicy .PolicyName != "" {
795+ metrics .AutogrowVolumes .WithLabelValues (
796+ volume .EffectiveAGPolicy .PolicyName ,
797+ volume .Config .StorageClass ,
798+ ).Inc ()
799+ }
800+ }
775801}
776802
777803func (o * TridentOrchestrator ) handleFailedTransaction (ctx context.Context , v * storage.VolumeTransaction ) error {
You can’t perform that action at this time.
0 commit comments