Commit 80e0ffc2 authored by Simon Tomlinson's avatar Simon Tomlinson Committed by Dylan Griffith

Log more information when service discovery fails

Adds the current host list length to the logged information when service
discovery fails. This will help to identify times when service discovery
fails and leaves the application with an empty host list.
parent a52ff217
...@@ -89,8 +89,10 @@ module Gitlab ...@@ -89,8 +89,10 @@ module Gitlab
# Sentry, instead of silently terminating this thread. # Sentry, instead of silently terminating this thread.
Gitlab::ErrorTracking.track_exception(error) Gitlab::ErrorTracking.track_exception(error)
Gitlab::AppLogger.error( Gitlab::Database::LoadBalancing::Logger.error(
"Service discovery encountered an error: #{error.message}" event: :service_discovery_failure,
message: "Service discovery encountered an error: #{error.message}",
host_list_length: load_balancer.host_list.length
) )
# Slightly randomize the retry delay so that, in the case of a total # Slightly randomize the retry delay so that, in the case of a total
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment