From 3882ea33585b3cefce22b561589f5f2be085b888 Mon Sep 17 00:00:00 2001 From: azul Date: Fri, 6 Nov 2015 11:12:13 +0100 Subject: [PATCH] Report failed requests for rails3 log format This also allows the munin plugin to pick them up. --- lib/request_log_analyzer/file_format/rails3.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/request_log_analyzer/file_format/rails3.rb b/lib/request_log_analyzer/file_format/rails3.rb index 08f04a90..b2097c1c 100644 --- a/lib/request_log_analyzer/file_format/rails3.rb +++ b/lib/request_log_analyzer/file_format/rails3.rb @@ -100,6 +100,9 @@ class Rails3 < Base analyze.frequency category: REQUEST_CATEGORIZER, title: 'Process blockers (> 1 sec duration)', if: lambda { |request| request[:duration] && request[:duration] > 1.0 } + + analyze.frequency :error, title: 'Failed requests', line_type: :failure, + if: lambda { |request| request[:error] } analyze.frequency category: lambda { |x| "[#{x[:missing_resource_method]}] #{x[:missing_resource]}" }, title: 'Routing Errors', if: lambda { |request| !request[:missing_resource].nil? }