Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 722 Bytes

File metadata and controls

29 lines (20 loc) · 722 Bytes

OpenTelemetry MySQL integration

The integration with MySQL supports the `mysql-connector`_ library and is specified to trace_integration using 'MySQL'.

Usage

import mysql.connector
from opentelemetry.trace import tracer
from opentelemetry.trace.ext.mysql import trace_integration

trace_integration(tracer())
cnx = mysql.connector.connect(database='MySQL_Database')
cursor = cnx.cursor()
cursor.execute("INSERT INTO test (testField) VALUES (123)"
cursor.close()
cnx.close()

References