From ee2e27084062f952fc781243f3776af3cd072e8f Mon Sep 17 00:00:00 2001 From: Andre Murbach Maidl Date: Tue, 6 May 2025 13:41:43 -0300 Subject: [PATCH] Improve mysqlclient instrumentation examples --- .../opentelemetry/instrumentation/mysqlclient/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py index 10c2b23a40..9e7dade9c9 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py @@ -26,12 +26,12 @@ import MySQLdb from opentelemetry.instrumentation.mysqlclient import MySQLClientInstrumentor - MySQLClientInstrumentor().instrument() cnx = MySQLdb.connect(database="MySQL_Database") cursor = cnx.cursor() - cursor.execute("INSERT INTO test (testField) VALUES (123)" + cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)") + cursor.execute("INSERT INTO test (testField) VALUES (123)") cnx.commit() cursor.close() cnx.close() @@ -52,7 +52,7 @@ cnx = MySQLdb.connect(database="MySQL_Database") cursor = cnx.cursor() cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)") - cursor.execute("INSERT INTO test (testField) VALUES (123)" + cursor.execute("INSERT INTO test (testField) VALUES (123)") cnx.commit() cursor.close() cnx.close() @@ -75,7 +75,7 @@ ) cursor = instrumented_cnx.cursor() cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)") - cursor.execute("INSERT INTO test (testField) VALUES (123)" + cursor.execute("INSERT INTO test (testField) VALUES (123)") instrumented_cnx.commit() cursor.close() instrumented_cnx.close()