[APM Java agent] Ignore Exception

Hi Elastic team,

Is there any way to ignore Exception catched in try catch block or ignore specific Exception ?

The latest apm (1.8.0) is collecting so many knowns errors, but I dont care about those exceptions.

Thanks,
Phuoc

1 Like

Hi :slight_smile:

currently, there is no such option.

How would you want to filter those? Based on the exception class or also the message?

Is there a change in behavior from previous versions?

Hi Felix,

Nothing changed from previous versions.

I think based on exception class is better.

And I got alot exceptions (Exception class) catched by try catch block from 3rd party, the index
apm-error grows so big because of those exceptions. Its very good if you can ignore them.

Regards,

Which 3rd party project are you talking about? How does that create an apm error?

this is an example in org.json.JSONObject

public long optLong(String var1, long var2) {
        try {
            return this.getLong(var1);
        } catch (Exception var5) {
            return var2;
        }
    }

But the agent is not automatically recording all exceptions in catch blocks. Are you using trace_methods to also trace 3rd party methods?

You are right, Im tracing JSONObject. Work fine after I removed it.

Thanks very much for your help.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.