Skip to content

Instrumented mysql not working with pymysql #363

Closed
@BrikerMan

Description

@BrikerMan

I 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions