We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dc8bea commit 72a01c0Copy full SHA for 72a01c0
components/usage/pkg/stripe/reporter.go
@@ -64,9 +64,12 @@ func reportStripeRequestStarted(resource string) {
64
}
65
66
func reportStripeRequestCompleted(resource string, err error, took time.Duration) {
67
- code := "unknown"
68
- if stripeErr, ok := err.(*stripe.Error); ok {
69
- code = string(stripeErr.Code)
+ code := "ok"
+ if err != nil {
+ code = "unknown"
70
+ if stripeErr, ok := err.(*stripe.Error); ok {
71
+ code = string(stripeErr.Code)
72
+ }
73
74
75
stripeClientRequestsCompletedSeconds.WithLabelValues(resource, code).Observe(took.Seconds())
0 commit comments