newrelic / newrelic-python-agent

New Relic Python Agent
https://docs.newrelic.com/docs/agents/python-agent
Apache License 2.0
173 stars 99 forks source link

mysql instrumentation in async contexts #952

Open nburns opened 10 months ago

nburns commented 10 months ago

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I'd like to be able to instrument database calls with an async mysql python module.

Feature Description

A clear and concise description of the feature you want or need. Support for aiomysql or a recommendation of a supported async mysql database connector for sqlalchemy.

Describe Alternatives

A clear and concise description of any alternative solutions or features you've considered. Are there examples you could link us to? Couldn't really find any alternatives, I was surprised that there were no hooks defined for the aiomysql package because it seems pretty popular for async python.

Additional context

Add any other context here. We're implementing graphql with async parallel resolution and will lose the ability to monitor sql timing/queries without agent support for aiomysql or another async mysql connector for sqlalchemy.

Priority

Please help us better understand this feature request by choosing a priority from the following options: Must Have

TimPansino commented 10 months ago

I can bring this feature up to our product team, is aiomysql the correct library to bring up? Or are there any others you've used?

nburns commented 10 months ago

aiomysql support would be preferred unless someone can point to another supported mysql async package, just wanted to leave open the possibility of me missing something and there being an existing solution that I wasn't aware of (kinda suprised that nobody had hit and raised this issue previously).

aiomysql seems to be the most popular, and the aio-libs org seems to produce decently high quality stuff, so that's currently our preference, asyncmy seems to also be a contender but less popular.

https://github.com/aio-libs/aiomysql https://github.com/long2ice/asyncmy