# Filtering out exceptions by class when tracing

**URL:** <https://discuss.elastic.co/t/filtering-out-exceptions-by-class-when-tracing/196864>\
**Category:** APM\
**Tags:** java\
**Created:** [August 27, 2019, 2:53am UTC](https://discuss.elastic.co/t/filtering-out-exceptions-by-class-when-tracing/196864 "2019-08-27T02:53:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Harris1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_harris1/32/52341_2.png) [@Paul\_Harris1](https://discuss.elastic.co/u/Paul_Harris1)\
**Post date:** [August 27, 2019, 2:53am UTC](https://discuss.elastic.co/t/filtering-out-exceptions-by-class-when-tracing/196864/1 "2019-08-27T02:53:46Z")

</div>

I've seen other chatter about this, but I think I have a use case which is valid.... hopefully 🙂

I've got an older application using tapestry 4.5, and the 'normal' method of changing page is to throw a PageRedirectException. This is fine, the code has been that way for ever, and it's relatively functional.

I've turned tracing on to see how the code is behaving, and in the 'Error's tab, I see thousands and thousands of 'errors' and the first few I've been investigating (highest counts) is ultimately because a PageRedirectException has been raised to go to a new application page.

I'd like to be able to filter errors, or filter adding things to the errors display, so that I can investigate issues without the noise of specific exceptions that I don't really want to see.

At a minimum it'd be great to be able to just not show PageRedirectExceptions, but I could also see cases where other possibilities would potentially be handy like optimistically trying to parse a string into an integer, and it raising an exception but that exception is handled and expected...

Maybe this is a case of 'im new to elastic-apm and there's a way to do this already' - i'd be equally happy if that's the case 🙂

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [August 27, 2019, 6:07am UTC](https://discuss.elastic.co/t/filtering-out-exceptions-by-class-when-tracing/196864/2 "2019-08-27T06:07:16Z")

</div>

We have an issue for that over at the Java agent's repo: [https://github.com/elastic/apm-agent-java/issues/762](https://github.com/elastic/apm-agent-java/issues/762)

Are you interested in creating a PR for this?

---

<div class="post-metadata">

**Author:** ![Paul\_Harris1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_harris1/32/52341_2.png) [@Paul\_Harris1](https://discuss.elastic.co/u/Paul_Harris1)\
**Post date:** [August 27, 2019, 6:48am UTC](https://discuss.elastic.co/t/filtering-out-exceptions-by-class-when-tracing/196864/3 "2019-08-27T06:48:27Z")

</div>

yep if it can be controlled via environment variables in the same way the trace variables can be, then that'd be perfect...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 17, 2019, 2:48am UTC](https://discuss.elastic.co/t/filtering-out-exceptions-by-class-when-tracing/196864/4 "2019-09-17T02:48:30Z")

</div>

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