-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Python: Add OpenTelemetry to Python SK #6914
Conversation
Python 3.10 Test Coverage Report
Python 3.10 Unit Test Overview
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some work to do, the basics are there, but most important is to refactor this into a decorator that we can use with all completion services and functions!
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
…chat_completion_base.py Co-authored-by: Tao Chen <[email protected]>
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see both naming with diagnostics (env setting and model_diagnostics.py file) and tracing, let's make that more consistent! And we really need to create a decorator out of the code inside openai_chat_completion_base!
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of small notes, but most importantly I don't see any tests for the actual span stuff...
Related to #5891 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of small notes, starting to look good!
Also just noticed that there are a bunch of lines in decorators.py not covered by tests, have a look at those please, @glahaye |
Oh, yes, I didn't know I needed "@pytest.mark.asyncio" for async tests. Fixed. |
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Show resolved
Hide resolved
### Motivation and Context We want observability into usage of SK ### Description Add OpenTelemetry to Python SK ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations --------- Co-authored-by: Tao Chen <[email protected]>
Motivation and Context
We want observability into usage of SK
Description
Add OpenTelemetry to Python SK
Contribution Checklist