-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from guanw/jude-retry-metrics
add metrics to retry handler
- Loading branch information
Showing
4 changed files
with
83 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package store | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
// Metrics defines all metrics for retry handler | ||
type Metrics struct { | ||
GetServiceRetryAttempts prometheus.Counter | ||
GetServiceRetryExhausted prometheus.Counter | ||
|
||
PostServiceRetryAttempts prometheus.Counter | ||
PostServiceRetryExhausted prometheus.Counter | ||
} | ||
|
||
// InitializeMetrics initialize retry metrics | ||
func InitializeMetrics() *Metrics { | ||
return &Metrics{ | ||
GetServiceRetryAttempts: promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "get_service_retry_attempts", | ||
}), | ||
GetServiceRetryExhausted: promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "get_service_retry_exhausted", | ||
}), | ||
PostServiceRetryAttempts: promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "update_service_retry_attempts", | ||
}), | ||
PostServiceRetryExhausted: promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "update_service_retry_exhausted", | ||
}), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters