Skip to content

Commit c0da153

Browse files
Reduce duplicate text, update doc header
1 parent d6af8cd commit c0da153

File tree

1 file changed

+17
-31
lines changed
  • instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi

1 file changed

+17
-31
lines changed

instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
The DB-API instrumentor and its utilities provide common, core functionality for
2424
database framework or object relation mapper (ORM) instrumentations. Users will
2525
typically instrument database client code with those framework/ORM-specific
26-
instrumentations, instead of directly using this DB-API integration. See full list
27-
at `instrumentation`_.
26+
instrumentations, instead of directly using this DB-API integration. Features
27+
such as sqlcommenter can be configured at framework/ORM level as well. See full
28+
list at `instrumentation`_.
2829
2930
.. _instrumentation: https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation
3031
@@ -57,15 +58,10 @@
5758
5859
SQLCommenter
5960
************
60-
sqlcommenter is supported by several Python database client framework/ORM-specific
61-
instrumentors. See their respective docs for how to opt into this feature at
62-
`instrumentation`_. There is no need to opt in at the DB-API level unless setting up
63-
its integration directly.
64-
65-
If using DB-API instrumentation directly, you can optionally enable sqlcommenter which
66-
enriches the query with contextual information. Queries made after setting up
67-
trace integration with sqlcommenter enabled will have configurable key-value pairs
68-
appended to them, e.g. ``"select * from auth_users; /*traceparent=00-01234567-abcd-01*/"``. This
61+
You can optionally enable sqlcommenter which enriches the query with contextual
62+
information. Queries made after setting up trace integration with sqlcommenter
63+
enabled will have configurable key-value pairs appended to them, e.g.
64+
``"select * from auth_users; /*traceparent=00-01234567-abcd-01*/"``. This
6965
supports context propagation between database client and server when database log
7066
records are enabled. For more information, see:
7167
@@ -89,16 +85,11 @@
8985
)
9086
9187
92-
SQLComment customization
93-
************************
94-
sqlcommenter is supported by several Python database client framework/ORM-specific
95-
instrumentors. See their respective docs for how to configure this feature at
96-
`instrumentation`_. There is no need to configure at the DB-API level unless setting up
97-
its integration directly.
98-
99-
If using DB-API instrumentation directly, the key-value pairs appended to the query
100-
can be configured using ``commenter_options``. When sqlcommenter is enabled, all
101-
available KVs/tags are calculated by default. ``commenter_options`` supports *opting out*
88+
SQLCommenter with commenter_options
89+
***********************************
90+
The key-value pairs appended to the query can be configured using
91+
``commenter_options``. When sqlcommenter is enabled, all available KVs/tags
92+
are calculated by default. ``commenter_options`` supports *opting out*
10293
of specific KVs.
10394
10495
.. code:: python
@@ -122,7 +113,7 @@
122113
}
123114
)
124115
125-
Available commenter options
116+
Available commenter_options
126117
###########################
127118
128119
The following sqlcomment key-values can be opted out of through ``commenter_options``:
@@ -147,15 +138,10 @@
147138
148139
SQLComment in span attribute
149140
****************************
150-
sqlcommenter is supported by several Python database client framework/ORM-specific
151-
instrumentors. See their respective docs for how to opt into this feature at
152-
`instrumentation`_. There is no need to opt in at the DB-API level unless setting up
153-
its integration directly.
154-
155-
If using DB-API instrumentation directly and sqlcommenter is enabled, you can opt into
156-
the inclusion of sqlcomment in the query span ``db.statement`` attribute for your needs.
157-
If ``commenter_options`` have been set, the span attribute comment will also be configured
158-
by this setting.
141+
If sqlcommenter is enabled, you can opt into the inclusion of sqlcomment in
142+
the query span ``db.statement`` attribute for your needs. If ``commenter_options``
143+
have been set, the span attribute comment will also be configured by this
144+
setting.
159145
160146
.. code:: python
161147

0 commit comments

Comments
 (0)