# Infinite Stack Recursion when using Sentry

**URL:** <https://meta.discourse.org/t/infinite-stack-recursion-when-using-sentry/254639>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [February 9, 2023, 4:23pm UTC](https://meta.discourse.org/t/infinite-stack-recursion-when-using-sentry/254639 "2023-02-09T16:23:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![saulshanabrook](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saulshanabrook/32/292864_2.png) [@saulshanabrook](https://meta.discourse.org/u/saulshanabrook)\
**Post date:** [February 13, 2023, 6:37pm UTC](https://meta.discourse.org/t/infinite-stack-recursion-when-using-sentry/254639/2 "2023-02-13T18:37:07Z")

</div>

For anyone interested in using Sentry with Discourse, one of the maintainers of the package [replied with a suggested fix](https://github.com/getsentry/sentry-ruby/issues/1999#issuecomment-1427136936).

They said that the problem was coming from Discourse’s `MethodProfiler` [which uses `alias_method`](https://github.com/discourse/discourse/blob/main/lib/method_profiler.rb#L16-L33). They suggested replacing that with `prepend` which they said was becoming more common and would allow both tools to work together.

I am not familiar enough with Ruby to understand the differences. For now, I will try commenting out this bit of code to disable Discourse’s method profiling.

---

_[View the full topic](https://meta.discourse.org/t/infinite-stack-recursion-when-using-sentry/254639)._
