DEV: Log error when calculating discourse_version

DEV: Log error when calculating discourse_version

diff --git a/lib/internal_metric/global.rb b/lib/internal_metric/global.rb
index f403fb4..a0a57e1 100644
--- a/lib/internal_metric/global.rb
+++ b/lib/internal_metric/global.rb
@@ -32,7 +32,8 @@ module DiscoursePrometheus::InternalMetric
 
       begin
         @@version ||= `git rev-list --count HEAD`.to_i
-      rescue
+      rescue => e
+        Discourse.warn_exception(e, message: "Failed to calculate discourse_version metric")
         @@version = 0
       end
 

GitHub sha: 8831e71f