I am having a similar problem.
Sometimes, our designed BPMN flow has endless loops in it. Loop in such a way that it just moves from one gate to another gate in an endless loop. That’s obviously due to the bad bpmn design. Such cases have sometimes brought the whole Camunda down because it fills up the Postgres Database 100% very quickly.
We want to be able to detect such stuck process instances before it brings down our Camunda. As I understand, I can’t use this interceptor cause it will only work if its executed inside a task. However, as mentioned above, sometimes we get endless loops that just moves from one gate to another in a circle.