Skip to content

Commit

Permalink
[release 1.1] Add detailed error reuslt_code in ObserveOperationWithR…
Browse files Browse the repository at this point in the history
…esult func
  • Loading branch information
lanlou1554 committed Jul 14, 2022
1 parent 2e348e2 commit 836a9f6
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 836a9f6

Please sign in to comment.