Export a counter of firehose connection errors
parent
ff0ea08296
commit
1358bc3f08
|
@ -97,6 +97,7 @@ func (c *Consumer) run(ctx context.Context) {
|
|||
default:
|
||||
if err := c.runOnce(ctx); err != nil {
|
||||
log.Error().Err(err).Msgf("Consumer of %q failed (will be restarted): %s", c.remote.Host, err)
|
||||
connectionFailures.WithLabelValues(c.remote.Host).Inc()
|
||||
}
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
|
|
@ -24,3 +24,8 @@ var postsByLanguageIndexed = promauto.NewCounterVec(prometheus.CounterOpts{
|
|||
Name: "indexer_posts_by_language_count",
|
||||
Help: "Number of posts by language",
|
||||
}, []string{"remote", "lang"})
|
||||
|
||||
var connectionFailures = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Name: "consumer_connection_failures",
|
||||
Help: "Counter of firehose connection failures",
|
||||
}, []string{"remote"})
|
||||
|
|
Loading…
Reference in New Issue