Skip to content

Commit

Permalink
fix: log stack trace while computing metrics (#2865)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Mar 1, 2024
1 parent 8e9e091 commit 41b4373
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/crowdsec/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ var globalPourHistogram = prometheus.NewHistogramVec(

func computeDynamicMetrics(next http.Handler, dbClient *database.Client) http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// catch panics here because they are not handled by servePrometheus
defer trace.CatchPanic("crowdsec/computeDynamicMetrics")
//update cache metrics (stash)
cache.UpdateCacheMetrics()
//update cache metrics (regexp)
Expand Down

0 comments on commit 41b4373

Please sign in to comment.