Skip to content

Commit

Permalink
Merge pull request #2025 from monianshouhou/detailed_latency_log_rele…
Browse files Browse the repository at this point in the history
…ase1.1

[release 1.1] Add detailed error reuslt_code in ObserveOperationWithR…
  • Loading branch information
k8s-ci-robot committed Jul 14, 2022
2 parents f2ea38d + 836a9f6 commit b1322f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/metrics/azure_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func (mc *MetricContext) ObserveOperationWithResult(isOperationSucceeded bool, l
resultCode := "succeeded"
if !isOperationSucceeded {
resultCode = "failed"
if len(mc.attributes) > 0 {
resultCode += mc.attributes[0][strings.Index(mc.attributes[0], "_"):]
}
mc.CountFailedOperation()
}
mc.logLatency(3, latency, append(labelAndValues, "result_code", resultCode)...)
Expand Down

0 comments on commit b1322f5

Please sign in to comment.