Part of #7203 This PR is mostly copy-paste and working around the differences, conceptually the new instrumentation is the same as the old one