Commit a33b86e2 authored by andyzhangx's avatar andyzhangx

fix incorrect prometheus metrics

parent ef9e794a
......@@ -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