Depending on the speed, accuracy and resolution the OP wants, it might be easier to do things on the mains side. Of course this needs to be taken into acount in terms of safety, and proper fuses need to be in place, isolation spacing has to be respected, and components must be selected that can handle those voltages safely.
Every circuit is dangerous to some extent - you can kill someone with a coin-cell battery if you can just stab the current close enough to the heart. Having respect for the possible dangers involved is far safer than just going "oh no this is dangerous so I'm just gonna run away from it".
The OP might not have provided suficient information for anybody to determine if the circuit is safe, but the OP has also not provided sufficient information to claim that the circuit is "[Unnecessarily] dangerous". So before we go run and scream danger, perhaps it is better to ask why the OP does it the way they do, and if they are aware of safety concerns.