Skip to content

Commit

Permalink
Merge pull request #1287 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1285-to-release-1.1

[release-1.1] chore: increase log level for ARM requests
  • Loading branch information
k8s-ci-robot committed Mar 18, 2022
2 parents f73742f + 6b6a559 commit 5f6da9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/metrics/azure_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (mc *MetricContext) Observe(rerr *retry.Error, labelAndValues ...interface{
attributes := append(mc.attributes, errorCode)
apiMetrics.errors.WithLabelValues(attributes...).Inc()
}
mc.logLatency(latency, append(labelAndValues, "error_code", rerr.ServiceErrorCode())...)
mc.logLatency(6, latency, append(labelAndValues, "error_code", rerr.ServiceErrorCode())...)
}

// ObserveOperationWithResult observes the request latency and failed requests of an operation.
Expand All @@ -101,15 +101,15 @@ func (mc *MetricContext) ObserveOperationWithResult(isOperationSucceeded bool, l
resultCode = "failed"
mc.CountFailedOperation()
}
mc.logLatency(latency, append(labelAndValues, "result_code", resultCode)...)
mc.logLatency(3, latency, append(labelAndValues, "result_code", resultCode)...)
}

func (mc *MetricContext) logLatency(latency float64, additionalKeysAndValues ...interface{}) {
func (mc *MetricContext) logLatency(logLevel int32, latency float64, additionalKeysAndValues ...interface{}) {
keysAndValues := []interface{}{"latency_seconds", latency}
for i, label := range metricLabels {
keysAndValues = append(keysAndValues, label, mc.attributes[i])
}
klog.V(3).InfoS("Observed Request Latency", append(keysAndValues, additionalKeysAndValues...)...)
klog.V(klog.Level(logLevel)).InfoS("Observed Request Latency", append(keysAndValues, additionalKeysAndValues...)...)
}

// CountFailedOperation increase the number of failed operations
Expand Down

0 comments on commit 5f6da9e

Please sign in to comment.