Skip to content

Commit

Permalink
feat(mysql): add support for mysql-connector-python v9 (#2751)
Browse files Browse the repository at this point in the history
  • Loading branch information
omikader authored Jul 31, 2024
1 parent bfcb16b commit dab664c
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2610](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2610))
- `opentelemetry-instrumentation-asgi` Bugfix: Middleware did not set status code attribute on duration metrics for non-recording spans.
([#2627](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2627))
- `opentelemetry-instrumentation-mysql` Add support for `mysql-connector-python` v9 ([#2751](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2751))

## Version 1.25.0/0.46b0 (2024-05-31)

Expand Down
2 changes: 1 addition & 1 deletion instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
| [opentelemetry-instrumentation-jinja2](./opentelemetry-instrumentation-jinja2) | jinja2 >= 2.7, < 4.0 | No | experimental
| [opentelemetry-instrumentation-kafka-python](./opentelemetry-instrumentation-kafka-python) | kafka-python >= 2.0 | No | experimental
| [opentelemetry-instrumentation-logging](./opentelemetry-instrumentation-logging) | logging | No | experimental
| [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python ~= 8.0 | No | experimental
| [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python >= 8.0, < 10.0 | No | experimental
| [opentelemetry-instrumentation-mysqlclient](./opentelemetry-instrumentation-mysqlclient) | mysqlclient < 3 | No | experimental
| [opentelemetry-instrumentation-pika](./opentelemetry-instrumentation-pika) | pika >= 0.12.0 | No | experimental
| [opentelemetry-instrumentation-psycopg](./opentelemetry-instrumentation-psycopg) | psycopg >= 3.1.0 | No | experimental
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [

[project.optional-dependencies]
instruments = [
"mysql-connector-python ~= 8.0",
"mysql-connector-python >= 8.0, < 10.0",
]

[project.entry-points.opentelemetry_instrumentor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.


_instruments = ("mysql-connector-python ~= 8.0",)
_instruments = ("mysql-connector-python >= 8.0, < 10.0",)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
asgiref==3.7.2
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
mysql-connector-python==9.0.0
packaging==24.0
pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
typing_extensions==4.9.0
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-dbapi
-e instrumentation/opentelemetry-instrumentation-mysql
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.48b0.dev",
},
{
"library": "mysql-connector-python ~= 8.0",
"library": "mysql-connector-python >= 8.0, < 10.0",
"instrumentation": "opentelemetry-instrumentation-mysql==0.48b0.dev",
},
{
Expand Down
12 changes: 9 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ envlist =
lint-exporter-prometheus-remote-write

; opentelemetry-instrumentation-mysql
py3{8,9,10,11,12}-test-instrumentation-mysql
pypy3-test-instrumentation-mysql
; The numbers at the end of the environment names
; below mean these dependencies are being used:
; 0: mysql-connector-python >=8.0.0,<9.0.0
; 1: mysql-connector-python ~=9.0.0
py3{8,9,10,11,12}-test-instrumentation-mysql-{0,1}
pypy3-test-instrumentation-mysql-{0,1}
lint-instrumentation-mysql

; opentelemetry-instrumentation-mysqlclient
Expand Down Expand Up @@ -562,7 +566,9 @@ commands_pre =
mysql: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
mysql: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
mysql: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
mysql: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt
mysql-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt
mysql-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-1.txt
lint-instrumentation-mysql: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-1.txt

mysqlclient: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
mysqlclient: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
Expand Down

0 comments on commit dab664c

Please sign in to comment.