Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WithCustomRegistry for metrics #118

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
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