Files
kubernetes/pkg/util
Kubernetes Submit Queue 194501c4aa Merge pull request #53571 from frodenas/util-metrics-error
Automatic merge from submit-queue (batch tested with PRs 53444, 52067, 53571, 53182). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Return an error if metric cannot be registered

**What this PR does / why we need it**:

`prometheus.MustRegister` panics if a metric cannot be registered. This PR replaces it with `prometheus.Register`, as it does not panic, and returns the error if the metric cannot be registered.

I also adds lacking tests for `RegisterMetricAndTrackRateLimiterUsage`.

**Which issue this PR fixes**:

Fixes #52872

**Special notes for your reviewer**:

None of the `metrics.RegisterMetricAndTrackRateLimiterUsage` invocations check the returned error, so I plan to submit new PRs to address this.

**Release note**:

```release-note
NONE
```
/sig instrumentation
2017-10-10 00:33:25 -07:00
..
2017-08-12 17:24:32 +10:00
2017-09-25 20:45:52 -07:00
2017-08-30 16:45:04 +02:00
2017-09-26 09:57:13 +08:00
2017-09-26 09:57:13 +08:00
2017-08-29 11:14:02 -07:00
2017-08-30 15:22:47 +02:00
2017-09-26 09:57:13 +08:00