GoogleCloudPlatform / fluent-plugin-detect-exceptions

A fluentd plugin that scans line-oriented log streams and combines exceptions stacks into a single log entry.
Apache License 2.0
192 stars 69 forks source link

Ability to include additional regular expressions for advanced stacktrace detection #82

Open juliohm1978 opened 4 years ago

juliohm1978 commented 4 years ago

I'm currently dealing with some Java applications that spew some uncommon error messages at the beginning of its stacktrace.

Here's an example:

2020-11-09 10:50:20,714 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-156) Interceptor for {http://impl.webservices.example.com/}numeracaoUnicaWS#{http://impl.webservices.example.com/}existeNumeroUnico has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Could not send Message.
        at org.apache.cxf@3.3.3//org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:67)
        at org.apache.cxf@3.3.3//org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at org.apache.cxf@3.3.3//org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
        at org.apache.cxf@3.3.3//org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
        at org.apache.cxf@3.3.3//org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:356)
        at org.apache.cxf@3.3.3//org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)
        at org.apache.cxf.impl//org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at org.apache.cxf.impl//org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)

...

Because it fails to match any of the hardcoded regular expressions, the plugin fails to group subsequent lines from the log.

Since it is not possible to predict how every application handles the output of a stacktrace, it would be an interesting addition to the plugin the ability to define custom regular expressions to further detect these uncommon cases.