Is it possible to move this to an `enable_instrumentation` method on the panel and also implement `disable_instrumentation`?

It avoids the performance overhead when the panel is disabled and depending on the order of imports.