Skip to content

Commit f85a0b5

Browse files
nicknicoliniocelotl
authored andcommitted
Use sqlalchemy version in sqlalchemy commenter instead of opentelemetry library version
The SqlAlchemy commenter is currently using the library version in the comment it emits, e.g.: ``` { 'db_driver': 'psycopg2', 'db_framework': 'sqlalchemy:0.45b0' } ``` We should instead be using the sqlalchemy version here, as SqlCommenter did before
1 parent 4e90498 commit f85a0b5

File tree

1 file changed

+2
-1
lines changed
  • instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy

1 file changed

+2
-1
lines changed

instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414
import os
1515
import re
16+
import sqlalchemy
1617
import weakref
1718

1819
from sqlalchemy.event import ( # pylint: disable=no-name-in-module
@@ -227,7 +228,7 @@ def _before_cur_exec(
227228
commenter_data = {
228229
"db_driver": conn.engine.driver,
229230
# Driver/framework centric information.
230-
"db_framework": f"sqlalchemy:{__version__}",
231+
"db_framework": f"sqlalchemy:{sqlalchemy.__version__}",
231232
}
232233

233234
if self.commenter_options.get("opentelemetry_values", True):

0 commit comments

Comments
 (0)