You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/__init__.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,6 @@
26
26
import pymysql
27
27
from opentelemetry.instrumentation.pymysql import PyMySQLInstrumentor
28
28
29
-
30
29
PyMySQLInstrumentor().instrument()
31
30
32
31
cnx = pymysql.connect(database="MySQL_Database")
@@ -41,6 +40,9 @@
41
40
You can optionally configure PyMySQL instrumentation to enable sqlcommenter which enriches
42
41
the query with contextual information.
43
42
43
+
Usage
44
+
-----
45
+
44
46
.. code:: python
45
47
46
48
import MySQLdb
@@ -55,11 +57,14 @@
55
57
cursor.close()
56
58
cnx.close()
57
59
60
+
58
61
For example,
59
62
::
63
+
60
64
Invoking cursor.execute("INSERT INTO test (testField) VALUES (123)") will lead to sql query "INSERT INTO test (testField) VALUES (123)" but when SQLCommenter is enabled
61
65
the query will get appended with some configurable tags like "INSERT INTO test (testField) VALUES (123) /*tag=value*/;"
62
66
67
+
63
68
SQLCommenter Configurations
64
69
***************************
65
70
We can configure the tags to be appended to the sqlquery log by adding configuration inside commenter_options(default:{}) keyword
0 commit comments