Autoinstrumentation is just monkeypatching with wrappers that call the OpenTelemetry SDK. Most (all?) of the public instrumentation lives at https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation. I found the Jinja2 instrumentation to be pretty simple to adapt for my own library. I just copied the opentelemetry-instrumentation-jinja2 folder to opentelemetry-instrumentation-mylibrary, and changed module names within. If you are OK with adding OpenTelemetry dependencies to your code, maybe https://opentelemetry.io/docs/languages/python/instrumentation/ would be more straightforward. The auto-instrumentation is pretty clean, though.