Skip to content

Commit

Permalink
Merge pull request #118 from ayanamist/master
Browse files Browse the repository at this point in the history
add WithCustomRegistry for metrics
  • Loading branch information
k8s-ci-robot committed Dec 22, 2022
2 parents 975107d + 2da996a commit dadad61
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions metrics/metrics.go
Expand Up @@ -179,6 +179,13 @@ func WithProcessStartTime(registerProcessStartTime bool) MetricsManagerOption {
}
}

// WithCustomRegistry allow user to use custom pre-created registry instead of a new created one.
func WithCustomRegistry(registry metrics.KubeRegistry) MetricsManagerOption {
return func(cmm *csiMetricsManager) {
cmm.registry = registry
}
}

// NewCSIMetricsManagerForSidecar creates and registers metrics for CSI Sidecars and
// returns an object that can be used to trigger the metrics. It uses "csi_sidecar"
// as subsystem.
Expand Down

0 comments on commit dadad61

Please sign in to comment.