diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f0b3c90b..7eef01e49d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- `opentelemetry-instrumentation-openai` Instrumentation for OpenAI >= 0.27.0 +- `opentelemetry-instrumentation-openai-v2` Instrumentation for OpenAI >= 0.27.0 ([#2759](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2759)) ### Added diff --git a/eachdist.ini b/eachdist.ini index 5b045b6996..c04fb571ce 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -50,7 +50,7 @@ packages= opentelemetry-resource-detector-azure opentelemetry-sdk-extension-aws opentelemetry-propagator-aws-xray - opentelemetry-instrumentation-openai + opentelemetry-instrumentation-openai-v2 opentelemetry-instrumentation-test [lintroots] diff --git a/instrumentation/README.md b/instrumentation/README.md index f8d188cec3..097550a217 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -29,7 +29,7 @@ | [opentelemetry-instrumentation-logging](./opentelemetry-instrumentation-logging) | logging | 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-openai](./opentelemetry-instrumentation-openai) | openai >= 0.27.0 | No | experimental +| [opentelemetry-instrumentation-openai](./opentelemetry-instrumentation-openai-v2) | openai >= 1.0.0 | 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 | [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 | No | experimental diff --git a/instrumentation/opentelemetry-instrumentation-openai-v2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-openai-v2/pyproject.toml index ddd6532ea7..b342cdade7 100644 --- a/instrumentation/opentelemetry-instrumentation-openai-v2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-openai-v2/pyproject.toml @@ -28,19 +28,18 @@ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-instrumentation ~= 0.48b0", "opentelemetry-semantic-conventions ~= 0.48b0" - ] [project.optional-dependencies] instruments = [ - "openai >= 0.27.0", + "openai >= 1.0.0", ] [project.entry-points.opentelemetry_instrumentor] openai = "opentelemetry.instrumentation.openai_v2:OpenAIInstrumentor" [project.urls] -Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-openai" +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-openai-v2" [tool.hatch.version] path = "src/opentelemetry/instrumentation/openai_v2/version.py" diff --git a/instrumentation/opentelemetry-instrumentation-openai-v2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-openai-v2/test-requirements.txt index 0b15775d2c..9385ece64e 100644 --- a/instrumentation/opentelemetry-instrumentation-openai-v2/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-openai-v2/test-requirements.txt @@ -7,4 +7,4 @@ pytest-vcr==1.0.2 wrapt==1.16.0 -e opentelemetry-instrumentation --e instrumentation/opentelemetry-instrumentation-openai +-e instrumentation/opentelemetry-instrumentation-openai-v2 diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 3912681d96..2b6b2cfedb 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -57,7 +57,7 @@ dependencies = [ "opentelemetry-instrumentation-logging==0.49b0.dev", "opentelemetry-instrumentation-mysql==0.49b0.dev", "opentelemetry-instrumentation-mysqlclient==0.49b0.dev", - "opentelemetry-instrumentation-openai==2.0.0.dev", + "opentelemetry-instrumentation-openai-v2==2.0.0.dev", "opentelemetry-instrumentation-pika==0.49b0.dev", "opentelemetry-instrumentation-psycopg==0.49b0.dev", "opentelemetry-instrumentation-psycopg2==0.49b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 3a3aedfaa9..95d25026f9 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -121,7 +121,7 @@ "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.49b0.dev", }, { - "library": "openai >= 0.27.0", + "library": "openai >= 1.0.0", "instrumentation": "opentelemetry-instrumentation-openai-v2==2.0.0.dev", }, { diff --git a/tox.ini b/tox.ini index 94fd1bc387..2c85207415 100644 --- a/tox.ini +++ b/tox.ini @@ -413,7 +413,7 @@ commands_pre = openai: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions openai: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk openai: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils - openai: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai/test-requirements.txt + openai: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-v2/test-requirements.txt distro: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api distro: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions @@ -470,7 +470,7 @@ commands_pre = openai: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api openai: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk openai: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions - openai: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai/test-requirements.txt + openai: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-v2/test-requirements.txt confluent-kafka: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api confluent-kafka: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions