fluent-plugin-detect-exceptions 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +66 -0
- data/README.rdoc +10 -0
- data/fluent-plugin-detect-exceptions.gemspec +1 -1
- data/lib/fluent/plugin/exception_detector.rb +20 -12
- data/test/plugin/test_exception_detector.rb +30 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c58018cba8b1e1901dd3ee3535abab41cb1e6df827ed31b846af250ce8576b7
|
4
|
+
data.tar.gz: d9624b643b2beae71d8c8e4807241aed9c1ed811cef569fd4a07ef7e095d7f0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d5a9de978855c5ac41e5639f9dab7705606c772ea35694299b1c917bdbc327ddf9937fcd64f4ee4c6e283c8dcc1b2de13b5dbc23f5c33ed96fe450dec0223f5
|
7
|
+
data.tar.gz: 5e04f33f4b0ec87ddfce9a9e0e1a09d8389e15c7896737ce8db11d41788aa0b0408e978047125908d7ff2917ad440f0c2144d0e974fa6d89c38d1878ca0f8279
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
fluent-plugin-detect-exceptions (0.0.12)
|
5
|
+
fluentd (>= 0.10)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.0)
|
11
|
+
cool.io (1.5.3)
|
12
|
+
dig_rb (1.0.1)
|
13
|
+
flexmock (2.3.6)
|
14
|
+
fluentd (1.2.6)
|
15
|
+
cool.io (>= 1.4.5, < 2.0.0)
|
16
|
+
dig_rb (~> 1.0.0)
|
17
|
+
http_parser.rb (>= 0.5.1, < 0.7.0)
|
18
|
+
msgpack (>= 0.7.0, < 2.0.0)
|
19
|
+
serverengine (>= 2.0.4, < 3.0.0)
|
20
|
+
sigdump (~> 0.2.2)
|
21
|
+
strptime (>= 0.2.2, < 1.0.0)
|
22
|
+
tzinfo (~> 1.0)
|
23
|
+
tzinfo-data (~> 1.0)
|
24
|
+
yajl-ruby (~> 1.0)
|
25
|
+
http_parser.rb (0.6.0)
|
26
|
+
msgpack (1.2.6)
|
27
|
+
parser (2.6.0.0)
|
28
|
+
ast (~> 2.4.0)
|
29
|
+
power_assert (1.1.3)
|
30
|
+
powerpack (0.1.2)
|
31
|
+
rainbow (2.2.2)
|
32
|
+
rake
|
33
|
+
rake (10.5.0)
|
34
|
+
rubocop (0.42.0)
|
35
|
+
parser (>= 2.3.1.1, < 3.0)
|
36
|
+
powerpack (~> 0.1)
|
37
|
+
rainbow (>= 1.99.1, < 3.0)
|
38
|
+
ruby-progressbar (~> 1.7)
|
39
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
40
|
+
ruby-progressbar (1.10.0)
|
41
|
+
serverengine (2.1.0)
|
42
|
+
sigdump (~> 0.2.2)
|
43
|
+
sigdump (0.2.4)
|
44
|
+
strptime (0.2.3)
|
45
|
+
test-unit (3.2.8)
|
46
|
+
power_assert
|
47
|
+
thread_safe (0.3.6)
|
48
|
+
tzinfo (1.2.5)
|
49
|
+
thread_safe (~> 0.1)
|
50
|
+
tzinfo-data (1.2018.9)
|
51
|
+
tzinfo (>= 1.0.0)
|
52
|
+
unicode-display_width (1.4.1)
|
53
|
+
yajl-ruby (1.4.1)
|
54
|
+
|
55
|
+
PLATFORMS
|
56
|
+
ruby
|
57
|
+
|
58
|
+
DEPENDENCIES
|
59
|
+
flexmock (~> 2.0)
|
60
|
+
fluent-plugin-detect-exceptions!
|
61
|
+
rake (~> 10.3)
|
62
|
+
rubocop (= 0.42.0)
|
63
|
+
test-unit (~> 3.0)
|
64
|
+
|
65
|
+
BUNDLED WITH
|
66
|
+
1.17.3
|
data/README.rdoc
CHANGED
@@ -98,12 +98,22 @@ The plugin supports the following parameters:
|
|
98
98
|
Example configuration:
|
99
99
|
|
100
100
|
<match **>
|
101
|
+
@type detect_exceptions
|
101
102
|
remove_tag_prefix foo
|
102
103
|
message log
|
103
104
|
languages java, python
|
104
105
|
multiline_flush_interval 0.1
|
105
106
|
</match>
|
106
107
|
|
108
|
+
== Extending language support
|
109
|
+
|
110
|
+
Supporting a new language requires new detection rules in this gem and
|
111
|
+
additional changes in the
|
112
|
+
{Stackdriver Error Reporting}[https://cloud.google.com/error-reporting/]
|
113
|
+
service. Please contact our product team by
|
114
|
+
{filing a support case}[https://cloud.google.com/support-hub/#google-cloud-platform]
|
115
|
+
if you'd like to see support for a new language.
|
116
|
+
|
107
117
|
== Copyright
|
108
118
|
|
109
119
|
Copyright:: Copyright 2016 Google Inc. All rights reserved.
|
@@ -11,7 +11,7 @@ eos
|
|
11
11
|
gem.homepage = \
|
12
12
|
'https://github.com/GoogleCloudPlatform/fluent-plugin-detect-exceptions'
|
13
13
|
gem.license = 'Apache-2.0'
|
14
|
-
gem.version = '0.0.
|
14
|
+
gem.version = '0.0.12'
|
15
15
|
gem.authors = ['Stackdriver Agents']
|
16
16
|
gem.email = ['stackdriver-agents@google.com']
|
17
17
|
gem.required_ruby_version = Gem::Requirement.new('>= 2.0')
|
@@ -13,7 +13,7 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
#
|
15
15
|
module Fluent
|
16
|
-
Struct.new('Rule', :
|
16
|
+
Struct.new('Rule', :from_states, :pattern, :to_state)
|
17
17
|
|
18
18
|
# Configuration of the state machine that detects exceptions.
|
19
19
|
module ExceptionDetectorConfig
|
@@ -41,8 +41,10 @@ module Fluent
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
def self.rule(
|
45
|
-
|
44
|
+
def self.rule(from_state_or_states, pattern, to_state)
|
45
|
+
from_state_or_states = [from_state_or_states] unless
|
46
|
+
from_state_or_states.is_a?(Array)
|
47
|
+
Struct::Rule.new(from_state_or_states, pattern, to_state)
|
46
48
|
end
|
47
49
|
|
48
50
|
def self.supported
|
@@ -50,12 +52,17 @@ module Fluent
|
|
50
52
|
end
|
51
53
|
|
52
54
|
JAVA_RULES = [
|
53
|
-
rule(:start_state,
|
55
|
+
rule([:start_state, :java_start_exception],
|
54
56
|
/(?:Exception|Error|Throwable|V8 errors stack trace)[:\r\n]/,
|
55
|
-
:
|
56
|
-
rule(:
|
57
|
-
|
58
|
-
rule(:
|
57
|
+
:java_after_exception),
|
58
|
+
rule(:java_after_exception, /^[\t ]*nested exception is:[\t ]*/,
|
59
|
+
:java_start_exception),
|
60
|
+
rule(:java_after_exception, /^[\r\n]*$/, :java_after_exception),
|
61
|
+
rule([:java_after_exception, :java], /^[\t ]+(?:eval )?at /, :java),
|
62
|
+
rule([:java_after_exception, :java], /^[\t ]*(?:Caused by|Suppressed):/,
|
63
|
+
:java_after_exception),
|
64
|
+
rule([:java_after_exception, :java],
|
65
|
+
/^[\t ]*... \d+ (?:more|common frames omitted)/, :java)
|
59
66
|
].freeze
|
60
67
|
|
61
68
|
PYTHON_RULES = [
|
@@ -76,13 +83,12 @@ module Fluent
|
|
76
83
|
|
77
84
|
GO_RULES = [
|
78
85
|
rule(:start_state, /\bpanic: /, :go_after_panic),
|
79
|
-
rule(:go_after_panic,
|
86
|
+
rule([:go_after_panic, :go_after_signal, :go_frame_1],
|
87
|
+
/^$/, :go_goroutine),
|
80
88
|
rule(:go_after_panic, /^\[signal /, :go_after_signal),
|
81
|
-
rule(:go_after_signal, /^$/, :go_goroutine),
|
82
89
|
rule(:go_goroutine, /^goroutine \d+ \[[^\]]+\]:$/, :go_frame_1),
|
83
90
|
rule(:go_frame_1, /^(?:[^\s.:]+\.)*[^\s.():]+\(|^created by /,
|
84
91
|
:go_frame_2),
|
85
|
-
rule(:go_frame_1, /^$/, :go_goroutine),
|
86
92
|
rule(:go_frame_2, /^\s/, :go_frame_1)
|
87
93
|
].freeze
|
88
94
|
|
@@ -169,7 +175,9 @@ module Fluent
|
|
169
175
|
rule_config.each do |r|
|
170
176
|
target = ExceptionDetectorConfig::RuleTarget.new(r[:pattern],
|
171
177
|
r[:to_state])
|
172
|
-
|
178
|
+
r[:from_states].each do |from_state|
|
179
|
+
@rules[from_state] << target
|
180
|
+
end
|
173
181
|
end
|
174
182
|
end
|
175
183
|
|
@@ -59,7 +59,35 @@ Caused by: com.example.myproject.MyProjectServletException
|
|
59
59
|
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
|
60
60
|
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
|
61
61
|
at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:30)
|
62
|
-
... 27
|
62
|
+
... 27 common frames omitted
|
63
|
+
END
|
64
|
+
|
65
|
+
NESTED_JAVA_EXC = <<END.freeze
|
66
|
+
java.lang.RuntimeException: javax.mail.SendFailedException: Invalid Addresses;
|
67
|
+
nested exception is:
|
68
|
+
com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied
|
69
|
+
|
70
|
+
at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendWithSmtp(AutomaticEmailFacade.java:236)
|
71
|
+
at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendSingleEmail(AutomaticEmailFacade.java:285)
|
72
|
+
at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.lambda$sendSingleEmail$3(AutomaticEmailFacade.java:254)
|
73
|
+
at java.util.Optional.ifPresent(Optional.java:159)
|
74
|
+
at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendSingleEmail(AutomaticEmailFacade.java:253)
|
75
|
+
at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendSingleEmail(AutomaticEmailFacade.java:249)
|
76
|
+
at com.nethunt.crm.api.email.EmailSender.lambda$notifyPerson$0(EmailSender.java:80)
|
77
|
+
at com.nethunt.crm.api.util.ManagedExecutor.lambda$execute$0(ManagedExecutor.java:36)
|
78
|
+
at com.nethunt.crm.api.util.RequestContextActivator.lambda$withRequestContext$0(RequestContextActivator.java:36)
|
79
|
+
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
80
|
+
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
81
|
+
at java.base/java.lang.Thread.run(Thread.java:748)
|
82
|
+
Caused by: javax.mail.SendFailedException: Invalid Addresses;
|
83
|
+
nested exception is:
|
84
|
+
com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied
|
85
|
+
|
86
|
+
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:2064)
|
87
|
+
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1286)
|
88
|
+
at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendWithSmtp(AutomaticEmailFacade.java:229)
|
89
|
+
... 12 more
|
90
|
+
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied
|
63
91
|
END
|
64
92
|
|
65
93
|
NODE_JS_EXC = <<END.freeze
|
@@ -531,6 +559,7 @@ END
|
|
531
559
|
def test_java
|
532
560
|
check_exception(JAVA_EXC, false)
|
533
561
|
check_exception(COMPLEX_JAVA_EXC, false)
|
562
|
+
check_exception(NESTED_JAVA_EXC, false)
|
534
563
|
end
|
535
564
|
|
536
565
|
def test_js
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-detect-exceptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stackdriver Agents
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -93,6 +93,7 @@ extra_rdoc_files: []
|
|
93
93
|
files:
|
94
94
|
- CONTRIBUTING
|
95
95
|
- Gemfile
|
96
|
+
- Gemfile.lock
|
96
97
|
- LICENSE
|
97
98
|
- README.rdoc
|
98
99
|
- Rakefile
|