-
Notifications
You must be signed in to change notification settings - Fork 641
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
Added Vertex AI spans for request parameters #3192
Merged
Merged
Conversation
This file contains 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
github-actions
bot
assigned alizenhom, codefromthecrypt, gyliu513, karthikscale3, lmolkova, lzchen and nirga
Jan 16, 2025
github-actions
bot
requested review from
alizenhom,
codefromthecrypt,
gyliu513,
karthikscale3,
lmolkova,
lzchen and
nirga
January 16, 2025 04:38
aabmass
force-pushed
the
vertex-0-impl
branch
from
January 16, 2025 05:03
72a92bb
to
105cf3c
Compare
aabmass
changed the title
Record spans and add tests for Vertex AI instrumentation
Added Vertex AI spans for request parameters
Jan 16, 2025
aabmass
force-pushed
the
vertex-0-impl
branch
2 times, most recently
from
January 16, 2025 05:12
8e8effb
to
76887e9
Compare
aabmass
commented
Jan 16, 2025
...i/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/utils.py
Outdated
Show resolved
Hide resolved
aabmass
force-pushed
the
vertex-0-impl
branch
from
January 16, 2025 05:42
76887e9
to
73cfcda
Compare
aabmass
force-pushed
the
vertex-0-impl
branch
from
January 16, 2025 19:35
73cfcda
to
816212b
Compare
9 tasks
aabmass
force-pushed
the
vertex-0-impl
branch
from
January 16, 2025 23:35
e3f0d72
to
66ed1de
Compare
Also this is what LangChain uses
aabmass
commented
Jan 17, 2025
...i/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/patch.py
Show resolved
Hide resolved
instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/test_chat_completions.py
Show resolved
Hide resolved
xrmx
reviewed
Jan 17, 2025
...i/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/utils.py
Outdated
Show resolved
Hide resolved
...i/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/utils.py
Outdated
Show resolved
Hide resolved
...i/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/utils.py
Show resolved
Hide resolved
xrmx
reviewed
Jan 21, 2025
...i/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/utils.py
Show resolved
Hide resolved
instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/test_chat_completions.py
Show resolved
Hide resolved
xrmx
reviewed
Jan 21, 2025
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.
A couple of nits but LGTM
lmolkova
reviewed
Jan 22, 2025
instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/test_chat_completions.py
Show resolved
Hide resolved
lmolkova
approved these changes
Jan 22, 2025
10 tasks
xrmx
pushed a commit
to xrmx/opentelemetry-python-contrib
that referenced
this pull request
Jan 24, 2025
* Added Vertex AI spans for request parameters * small fixes, get CI passing * Use standard OTel tracing error handling * move nested util * Actually use GAPIC client since thats what we use under the hood Also this is what LangChain uses * Comment out seed for now * Remove unnecessary dict.get() calls * Typing improvements to check that we support both v1 and v1beta1 * Add more teest cases for error conditions and fix span name bug * fix typing * Add todos for error.type
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Part of #3041, follow up to #3123.
Adds basic tracing instrumentation for Vertex AI. Right now, it supports only request span attributes–I will add response attributes and content logging in later PR(s). I also added VCR tests with proper sanitization.
In the end, I didn't copy any code from OpenLLMetry and mostly adapted from openai-v2. Also the code is typed 😃
This instrumentation wraps the underlying prediction service GAPIC clients. It works for both v1 and v1beta1 APIs which is statically checked.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
CORE_REPO_SHA=f8df9051ca883b63a9047533e6d0b26f24e53b71 tox -re typecheck
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.