Instrumented mysql not working with pymysql
See original GitHub issueI am using PyMySQL==0.9.2
for MySQL connection. I can’t get MySQL instrument for my requests.
repreduce If I just import pumysql, agent will not found the mysql module.
import pymysql
pymysql.connect(**db_conf,
charset='utf8mb4',
cursorclass=pymysql.cursors.SSDictCursor)
# LOG
DEBUG elasticapm.instrument:base.py:73 - Skipping instrumentation of mysql. Module MySQLdb not found
If I just import pumysql as MySQLdb
, agent will found the mysql module, but not working.
import pymysql
pymysql.install_as_MySQLdb()
pymysql.connect(**db_conf,
charset='utf8mb4',
cursorclass=pymysql.cursors.SSDictCursor)
# LOG
DEBUG elasticapm.instrument:base.py:82 - Instrumented mysql, MySQLdb.connect
Environment (please complete the following information)
- OS: mac 10.14.2 (18C54)
- Python version: python 3.6.5
- Framework and version [e.g. Django 2.1]: Flask==1.0.2
- APM Server version: 6.4.0
- Agent version: elastic-apm==3.0.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why does pymysql hang on a select statement that works fine ...
As I said before, running the query in MySQL workbench returns results immediately. The query itself is shown below: SELECT at.instrument, at.
Read more >Connect to MySQL using PyMySQL in Python - GeeksforGeeks
In this article, we will discuss how to connect to the MySQL database remotely or locally using Python. In below process, we will...
Read more >PyMySQL - PyPI
This package contains a pure-Python MySQL client library, based on PEP 249. Most public APIs are compatible with mysqlclient and MySQLdb.
Read more >Integrations — ddtrace documentation - Read the Docs
The pymysql integration instruments the pymysql library to trace MySQL queries. Enabling¶. The integration is enabled automatically when using ddtrace-run or ...
Read more >Connection to RDS database not working : r/aws - Reddit
I'm trying to connect to a RDS database that already has public access, with this code: connection = pymysql.connect(host=host, user=user…
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @BrikerMan
unfortunately, we don’t yet support pymysql instrumentation, and I’m unfamiliar with its MySQLdb compatibility mode.
While adding support for pymysql would probably be relatively straight forward, we need to be vary to not overload the agent with built-in instrumentations. Every new instrumentation we write needs to be tested, supported and updated, adding a lot of additional load. We are currently looking into ways to add custom module instrumentation without having to depend on built-in instrumentation.
We now support pymysql: https://github.com/elastic/apm-agent-python/pull/603