-
Notifications
You must be signed in to change notification settings - Fork 951
Minor changes to GenAi utils lib #4570
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7c55a5e
Minor changes to utils lib
DylanRussell 83d4ed8
Make changes
DylanRussell e4094ab
Merge branch 'main' into more_genai_changes
DylanRussell d371065
Simplify ContextManager stuff
DylanRussell 25c5343
Merge branch 'main' into more_genai_changes
DylanRussell 180cfb2
Fix tests
DylanRussell 2265d62
Revert changes to lock file
DylanRussell 75a4f9d
Revert uv lock file changes
DylanRussell 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
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.
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.
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.
we should not need it in the long term - any is a valid span attribute type, we just don't support it yet in python. should we keep this method in the libs that need it?
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.
well anyone that uses this will need it until that change goes through.. is there an open bug or something that I can put here to say we will eventually remove this ?
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.
it's not used today by existing instrumentations - it's done internally via
opentelemetry-python-contrib/util/opentelemetry-util-genai/src/opentelemetry/util/genai/_invocation.py
Line 179 in 5caa9ac
removing public api in the future is costry, so if there is 1-2 spots where it's actually needed copy-paste is better than future breaking changes.
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.
Right that code serializes everything to a string -- that's the same thing I'm doing here -- it sounds like you are saying we should not be doing that IIUC ? but instead do it in the instrumentation libraries so people don't get the wrong idea ?
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'm saying that most instrumentation libs don't need this method to be public in the utils. And those who do migh be better with having this logic internal as well so that they won't suffer from utils removing this method in the future.
My main worry is utils becoming a pile of disjoint helpers (what usually happens with utils) which is impossible to clean up or consolidate because it's breaking everyone. If things are internal it's much of a smaller problem to solve.
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.
Ok that's fair.. Can you take a look at the updates i've made ? The issue is I need to serialize an Any. For now I just ended up using the existing utility to do it.