Unverified Commit 88996f82 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #77855 from andyzhangx/automated-cherry-pick-of-#77722-upstream-release-1.14

Automated cherry pick of #77722: fix incorrect prometheus metrics
parents 39fc3c49 59a89867
......@@ -50,12 +50,14 @@ func newMetricContext(prefix, request, resourceGroup, subscriptionID string) *me
}
}
func (mc *metricContext) Observe(err error) {
func (mc *metricContext) Observe(err error) error {
apiMetrics.latency.WithLabelValues(mc.attributes...).Observe(
time.Since(mc.start).Seconds())
if err != nil {
apiMetrics.errors.WithLabelValues(mc.attributes...).Inc()
}
return err
}
func registerAPIMetrics(attributes ...string) *apiCallMetrics {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment