Skip to content

Commit

Permalink
structure folder for openai v2
Browse files Browse the repository at this point in the history
  • Loading branch information
alizenhom committed Sep 9, 2024
1 parent d52460e commit 6b453e1
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ instruments = [
]

[project.entry-points.opentelemetry_instrumentor]
openai = "opentelemetry.instrumentation.openai:OpenAIInstrumentor"
openai = "opentelemetry.instrumentation.openai.v2:OpenAIInstrumentor"

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-openai"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from wrapt import wrap_function_wrapper

from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.instrumentation.openai.package import _instruments
from opentelemetry.instrumentation.openai.v2.package import _instruments
from opentelemetry.trace import get_tracer

from .patch import chat_completions_create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Deprecated==1.2.14
importlib-metadata==6.11.0
packaging==24.0
pytest==7.4.4
pytest-vcr==1.0.2
wrapt==1.16.0
# -e opentelemetry-instrumentation
# -e instrumentation/opentelemetry-instrumentation-openai

-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-openai
16 changes: 16 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ envlist =
; Environments are organized by individual package, allowing
; for specifying supported Python versions per package.

; instrumentation-openai
py3{8,9,10,11,12}-test-instrumentation-openai
pypy3-test-instrumentation-openai
lint-instrumentation-openai

; opentelemetry-resource-detector-container
py3{8,9,10,11,12}-test-resource-detector-container
pypy3-test-resource-detector-container
Expand Down Expand Up @@ -399,6 +404,12 @@ commands_pre =
opentelemetry-instrumentation: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
opentelemetry-instrumentation: pip install -r {toxinidir}/opentelemetry-instrumentation/test-requirements.txt

openai: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
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

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
distro: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
Expand Down Expand Up @@ -445,6 +456,11 @@ commands_pre =
kafka-pythonng: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
kafka-pythonng: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements-ng.txt

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

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
confluent-kafka: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
Expand Down

0 comments on commit 6b453e1

Please sign in to comment.