Sometimes, it gets to very hacky solutions, such as what we did at Laminar with Claude Agent SDK. Basically we spin up a tiny in-process proxy that intercepts requests and responses and emits the telemetry as OTEL traces. We repoint the Python / JS SDK to convince the harness that our proxy is the anthropic URL, and the proxy then forward the request downstream. I wrote about it some time ago [1]. This is definitely not elegant, but it generally works.
[1] https://laminar.sh/blog/2025-12-03-claude-agent-sdk-instrume...