Skip to content

Commit

Permalink
Initialise reason="connect-timeout" series for cache `operation_fai…
Browse files Browse the repository at this point in the history
…lures_total` metric (#545)

* Initialise `reason="connect-timeout"` series for memcached `operation_failures_total` metric

* Add changelog entry
  • Loading branch information
charleskorn authored Jul 12, 2024
1 parent 6c2188e commit b834d6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,4 @@
* [BUGFIX] middleware: fix issue where applications that used the httpgrpc tracing middleware would generate duplicate spans for incoming HTTP requests. #451
* [BUGFIX] httpgrpc: store headers in canonical form when converting from gRPC to HTTP. #518
* [BUGFIX] Memcached: Don't truncate sub-second TTLs to 0 which results in them being cached forever. #530
* [BUGFIX] Cache: initialise the `operation_failures_total{reason="connect-timeout"}` metric to 0 for each cache operation type on startup. #545
1 change: 1 addition & 0 deletions cache/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func newClientMetrics(reg prometheus.Registerer) *clientMetrics {
Help: "Total number of operations against cache that failed.",
}, []string{"operation", "reason"})
for _, op := range []string{opGetMulti, opSet, opDelete, opIncrement, opFlush, opTouch, opCompareAndSwap} {
cm.failures.WithLabelValues(op, reasonConnectTimeout)
cm.failures.WithLabelValues(op, reasonTimeout)
cm.failures.WithLabelValues(op, reasonMalformedKey)
cm.failures.WithLabelValues(op, reasonServerError)
Expand Down

0 comments on commit b834d6b

Please sign in to comment.