-
Notifications
You must be signed in to change notification settings - Fork 711
Add Initial Support for Instrumenting OpenAI Python Library - Chat Completion Create #2759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lzchen
merged 53 commits into
open-telemetry:main
from
Scale3-Labs:openai-opentelemetry
Oct 22, 2024
Merged
Changes from 9 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
c7b3c97
[WIP] Initial commit for OpenAI instrumentation
karthikscale3 52a5f07
Merge branch 'main' into openai-opentelemetry
karthikscale3 6383978
Merge branch 'main' of github.com:Scale3-Labs/opentelemetry-python-co…
alizenhom e1bca1a
Loosen openai version for instrumentation + linting
alizenhom 94c10f4
fix wrong patch.py import
alizenhom bb97ec9
add missing dependecies tiktoken & pydantic
alizenhom e15d443
remove async support from `StreamWrapper` until further notice
alizenhom 1efdfcd
addressing comments:
alizenhom 892d388
Merge branch 'open-telemetry:main' into openai-opentelemetry
alizenhom e7398a2
Merge branch 'open-telemetry:main' into openai-opentelemetry
alizenhom e601f6d
Merge branch 'open-telemetry:main' into openai-opentelemetry
alizenhom df3fc62
Merge branch 'open-telemetry:main' into openai-opentelemetry
alizenhom d04edad
Refactoring Openai instrumentation
alizenhom b8dde6c
Merge branch 'openai-opentelemetry' of github.com:Scale3-Labs/opentel…
alizenhom ec3c320
remove `SpanAttributes` and refactor streamwrapper
alizenhom 706c6f2
change instrumentation name & fix some nits
alizenhom 71aaeb6
change openai package name
alizenhom 8495a24
cleanup setting prompt events & finish reasons
alizenhom 885b7fd
catch connection drops and reraise error in streaming
alizenhom 6ac04cb
run `tox -e generate`
alizenhom 42370a7
run linter
alizenhom c5ef8c3
run `tox -e generate`
alizenhom d52460e
add changelog
alizenhom 452d41a
test requirments + tox ini
alizenhom 48fb3fb
Merge branch 'main' of github.com:open-telemetry/opentelemetry-python…
alizenhom e9a76c4
remove LLMSpanAttributes validation layer
alizenhom 3d5a2b3
add tests
alizenhom b583aa0
enhance build settings
alizenhom ae9bc2a
Merge branch 'main' of github.com:open-telemetry/opentelemetry-python…
alizenhom f2a5cfa
address test comments
alizenhom e701678
Merge branch 'open-telemetry:main' into openai-opentelemetry
alizenhom a457df2
Merge branch 'main' into openai-opentelemetry
karthikscale3 3bdfd8f
run `tox -e generate` & `tox -e generate-workflows`
alizenhom 41cbfd0
Update instrumentation/opentelemetry-instrumentation-openai/src/opent…
karthikscale3 f3b7c0e
Merge branch 'main' into openai-opentelemetry
karthikscale3 8813754
Merge branch 'main' into openai-opentelemetry
karthikscale3 578653d
change folder name to v2
alizenhom 578a942
adjust all naming to -v2
alizenhom 51f2438
run `tox -e generate`
alizenhom 8b58f27
adjust tests
alizenhom d467eb1
set attributes only when span is recording
alizenhom ad7f198
`model` fallback to `gpt-3.5-turbo`
alizenhom 5e4c2b2
Merge branch 'open-telemetry:main' into openai-opentelemetry
alizenhom bbee109
adjust `-v2` for linting
alizenhom 9ac90f9
make sure span is recording before setting attributes
alizenhom 2549f25
pass span_attributes when creating span inside `start_span`
alizenhom 1dacf8d
adjust unwrap + add pydantic to test reqs
alizenhom 4048410
bump openai support to `1.26.0`
alizenhom 8fc4336
run `tox -e generate` & `tox -e generate-workflows`
alizenhom 9e273f6
add uninstrument in tests + remove any none values from span attributes
alizenhom 8e667de
cleanup
alizenhom 592c18e
adjust `unwrap`
alizenhom cd8b098
Merge branch 'open-telemetry:main' into openai-opentelemetry
alizenhom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
instrumentation/opentelemetry-instrumentation-openai/README.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
# limitations under the License. | ||
|
||
|
||
_instruments = ("openai ~= 1.37.1",) | ||
_instruments = ("openai >= 0.27.0",) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.