-
Notifications
You must be signed in to change notification settings - Fork 837
Description
What problem do you want to solve?
The current opentelemetry-instrumentation-botocore library only instruments the botocore library (which boto3 is built on top of). However, it lacks support for the async implementation aiobotocore. I see that previously there was interest in adding a dedicated opentelemetry-instrumentation-aiobotocore library (see #1709), but was turned down to limit the scope of instrumentation libraries supported. Fortunately, the aiobotocore implementation is essentially a direct asynchronous port of botocore, so a dedicated library likely isn't needed.
Describe the solution you'd like
As mentioned above, given that aiobotocore is effectively an async port of botocore, nearly all of the existing instrumentation logic and extensions can be reused (with the exception of the Bedrock extension). The aiobotocore client extends the botocore base client and any errors are raised as botocore errors. In fact, the only changes required to add support for aiobotocore would be to patch the two equivalent async functions in aiobotocore. A reasonable approach is as follows:
- Add an
AiobotocoreInstrumentorclass inopentelemetry-instrumentation-botocore, and patch the relevant async functions, reusing the existing extension logic already implemented while externalizing some logic inBotocoreInstrumentorto allow for more code reuse. - Add an
aiobotocoreentrypoint to thepyproject.tomlfor auto instrumentation. - Define separate known extensions maps for
botocoreandaiobotocoreto prevent potential errors from using extensions not compatible withaiobotocore(i.e. Bedrock). Note: we can update the bedrock extension to supportaiobotocoreat a later point to re-consolidate the extension maps.
If the team thinks the proposed outline is acceptable, I am more than happy to contribute these changes.
Would you like to implement a fix?
Yes
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.