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-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,26 @@
102
102
::
103
103
Enabling this flag will add traceparent values /*traceparent='00-03afa25236b8cd948fa853d67038ac79-405ff022e8247c46-01'*/
104
104
105
+
SQLComment in span attribute
106
+
****************************
107
+
If sqlcommenter is enabled, you can optionally configure MySQLClient instrumentation to append sqlcomment to query span attribute for convenience of your platform.
108
+
109
+
.. code:: python
110
+
111
+
from opentelemetry.instrumentation.mysqlclient import MySQLClientInstrumentor
112
+
113
+
MySQLClientInstrumentor().instrument(
114
+
enable_commenter=True,
115
+
enable_attribute_commenter=True,
116
+
)
117
+
118
+
119
+
For example,
120
+
::
121
+
122
+
Invoking cursor.execute("select * from auth_users") will lead to sql query "select * from auth_users" but when SQLCommenter and attribute_commenter are enabled
123
+
the query will get appended with some configurable tags like "select * from auth_users /*tag=value*/;" for both server query and `db.statement` span attribute.
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,26 @@
80
80
::
81
81
Enabling this flag will add traceparent values /*traceparent='00-03afa25236b8cd948fa853d67038ac79-405ff022e8247c46-01'*/
82
82
83
+
SQLComment in span attribute
84
+
****************************
85
+
If sqlcommenter is enabled, you can optionally configure psycopg instrumentation to append sqlcomment to query span attribute for convenience of your platform.
86
+
87
+
.. code:: python
88
+
89
+
from opentelemetry.instrumentation.psycopg import PsycopgInstrumentor
90
+
91
+
PsycopgInstrumentor().instrument(
92
+
enable_commenter=True,
93
+
enable_attribute_commenter=True,
94
+
)
95
+
96
+
97
+
For example,
98
+
::
99
+
100
+
Invoking cursor.execute("select * from auth_users") will lead to postgresql query "select * from auth_users" but when SQLCommenter and attribute_commenter are enabled
101
+
the query will get appended with some configurable tags like "select * from auth_users /*tag=value*/;" for both server query and `db.statement` span attribute.
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,26 @@
80
80
::
81
81
Enabling this flag will add traceparent values /*traceparent='00-03afa25236b8cd948fa853d67038ac79-405ff022e8247c46-01'*/
82
82
83
+
SQLComment in span attribute
84
+
****************************
85
+
If sqlcommenter is enabled, you can optionally configure psycopg2 instrumentation to append sqlcomment to query span attribute for convenience of your platform.
86
+
87
+
.. code:: python
88
+
89
+
from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor
90
+
91
+
Psycopg2Instrumentor().instrument(
92
+
enable_commenter=True,
93
+
enable_attribute_commenter=True,
94
+
)
95
+
96
+
97
+
For example,
98
+
::
99
+
100
+
Invoking cursor.execute("select * from auth_users") will lead to postgresql query "select * from auth_users" but when SQLCommenter and attribute_commenter are enabled
101
+
the query will get appended with some configurable tags like "select * from auth_users /*tag=value*/;" for both server query and `db.statement` span attribute.
0 commit comments