Skip to content

Commit dadad61

Browse files
authored
Merge pull request #118 from ayanamist/master
add WithCustomRegistry for metrics
2 parents 975107d + 2da996a commit dadad61

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

metrics/metrics.go

+7
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ func WithProcessStartTime(registerProcessStartTime bool) MetricsManagerOption {
179179
}
180180
}
181181

182+
// WithCustomRegistry allow user to use custom pre-created registry instead of a new created one.
183+
func WithCustomRegistry(registry metrics.KubeRegistry) MetricsManagerOption {
184+
return func(cmm *csiMetricsManager) {
185+
cmm.registry = registry
186+
}
187+
}
188+
182189
// NewCSIMetricsManagerForSidecar creates and registers metrics for CSI Sidecars and
183190
// returns an object that can be used to trigger the metrics. It uses "csi_sidecar"
184191
// as subsystem.

0 commit comments

Comments
 (0)