-
Notifications
You must be signed in to change notification settings - Fork 783
Update vertexai instrumentation to be in-line with the latest semantic conventions part 2 #3799
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
Merged
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7e139ac
More changes
DylanRussell 5dd2a21
Update instrumentation to emit spans in the new format, call the uplo…
DylanRussell a65ce73
Update example and changelog
DylanRussell 35bcad9
Merge branch 'main' into vertexai_v4
DylanRussell c31ad9f
Fix linter
DylanRussell 315af3a
Merge branch 'vertexai_v4' of github.com:DylanRussell/opentelemetry-p…
DylanRussell 7f03e05
Respond to comments
DylanRussell 24a3d42
Merge branch 'main' into vertexai_v4
DylanRussell 35ddd52
move decoder to utils
DylanRussell d17cf1d
fix import
DylanRussell dbd54ff
Respond to comments
DylanRussell 28cad57
resolve docs error hopefully
DylanRussell 97d300f
Add docstring
DylanRussell 08103d8
Update system instruction from 1 text part to a list of MessageParts
DylanRussell d313342
Merge branch 'main' into vertexai_v4
DylanRussell 19af618
Update json.dumps call to use different separators
DylanRussell 910f8a6
Merge branch 'vertexai_v4' of github.com:DylanRussell/opentelemetry-p…
DylanRussell 9390cb5
expose just a json util
aabmass f2c1057
remove unnecessary doc
aabmass 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
interactions: | ||
- request: | ||
body: "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": | ||
[\n {\n \"text\": \"Get weather details in New Delhi and San | ||
Francisco?\"\n }\n ]\n },\n {\n \"role\": \"model\",\n | ||
\ \"parts\": [\n {\n \"functionCall\": {\n \"name\": | ||
\"get_current_weather\",\n \"args\": {\n \"location\": | ||
\"New Delhi\"\n }\n }\n },\n {\n \"functionCall\": | ||
{\n \"name\": \"get_current_weather\",\n \"args\": {\n | ||
\ \"location\": \"San Francisco\"\n }\n }\n | ||
\ }\n ]\n },\n {\n \"role\": \"user\",\n \"parts\": | ||
[\n {\n \"functionResponse\": {\n \"name\": \"get_current_weather\",\n | ||
\ \"response\": {\n \"content\": \"{\\\"temperature\\\": | ||
35, \\\"unit\\\": \\\"C\\\"}\"\n }\n }\n },\n {\n | ||
\ \"functionResponse\": {\n \"name\": \"get_current_weather\",\n | ||
\ \"response\": {\n \"content\": \"{\\\"temperature\\\": | ||
25, \\\"unit\\\": \\\"C\\\"}\"\n }\n }\n }\n ]\n | ||
\ }\n ],\n \"tools\": [\n {\n \"functionDeclarations\": [\n {\n | ||
\ \"name\": \"get_current_weather\",\n \"description\": \"Get | ||
the current weather in a given location\",\n \"parameters\": {\n \"type\": | ||
6,\n \"properties\": {\n \"location\": {\n \"type\": | ||
1,\n \"description\": \"The location for which to get the weather. | ||
It can be a city name, a city name and state, or a zip code. Examples: 'San | ||
Francisco', 'San Francisco, CA', '95616', etc.\"\n }\n },\n | ||
\ \"propertyOrdering\": [\n \"location\"\n ]\n | ||
\ }\n }\n ]\n }\n ]\n}" | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '1731' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- python-requests/2.32.3 | ||
x-goog-api-client: | ||
- model-builder/1.79.0+top_google_constructor_method+vertexai.generative_models.GenerativeModel.generate_content | ||
gl-python/3.11.9 grpc/1.68.1 gax/2.23.0 gapic/1.79.0+top_google_constructor_method+vertexai.generative_models.GenerativeModel.generate_content | ||
x-goog-request-params: | ||
- model=projects/fake-project/locations/us-central1/publishers/google/models/gemini-2.5-pro | ||
method: POST | ||
uri: https://us-central1-aiplatform.googleapis.com/v1/projects/fake-project/locations/us-central1/publishers/google/models/gemini-2.5-pro:generateContent?%24alt=json%3Benum-encoding%3Dint | ||
response: | ||
body: | ||
string: !!binary | | ||
H4sIAAAAAAAC/91TwU7rMBC89ytWPRcHECdOVG3EqwQFkXJCCBlnSRccb7A3BYT679ghQODAgeM7 | ||
OTueHc+OndcRwBi9Zz8+hNdYxNJwibE62N2bvAM1hqCrhI0v8LHFIEABagqBXAU+QuSxBN3KGp2Q | ||
0ULswEQsldoqyJ8bNBI5Z9NIgn3QxkRREH5ANwHLFcUG5gdCYA8chTxstKVfVQtEWIs04TDLStyg | ||
5QZ9UBVzZVEZrjPquPKSBarcDrnsCW8T1bALbHGn8XwfjalxP2kQLW1Ig14up5erf/lytZhNV/n8 | ||
g1CiaLKJcdUB0IfWbR7JS9OllNbehm4odFZ6V74xao63bbVwd9yrDpT/54z7WbeTvyeXp5f6MzmP | ||
OrBL3bOLfJ6ubHpS3JwuimKxPP4WMdeaOuL3E4acOl5DqUV//g5f+JrLr15lLLel0tRYLXfsa7XZ | ||
U+cxODIpwwL9hgyqY3ToteCMncSYBiel1/ZOSqIDnR/ePhu2o+F6PUpf29EbabJOVcEDAAA= | ||
headers: | ||
Content-Encoding: | ||
- gzip | ||
Content-Type: | ||
- application/json; charset=UTF-8 | ||
Date: | ||
- Tue, 30 Sep 2025 15:26:53 GMT | ||
Server: | ||
- scaffolding on HTTPServer2 | ||
Transfer-Encoding: | ||
- chunked | ||
Vary: | ||
- Origin | ||
- X-Origin | ||
- Referer | ||
WWW-Authenticate: | ||
- Bearer realm="https://accounts.google.com/" | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-XSS-Protection: | ||
- '0' | ||
status: | ||
code: 401 | ||
message: Unauthorized | ||
version: 1 |
DylanRussell marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
interactions: | ||
- request: | ||
body: "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": | ||
[\n {\n \"text\": \"Get weather details in New Delhi and San | ||
Francisco?\"\n }\n ]\n },\n {\n \"role\": \"model\",\n | ||
\ \"parts\": [\n {\n \"functionCall\": {\n \"name\": | ||
\"get_current_weather\",\n \"args\": {\n \"location\": | ||
\"New Delhi\"\n }\n }\n },\n {\n \"functionCall\": | ||
{\n \"name\": \"get_current_weather\",\n \"args\": {\n | ||
\ \"location\": \"San Francisco\"\n }\n }\n | ||
\ }\n ]\n },\n {\n \"role\": \"user\",\n \"parts\": | ||
[\n {\n \"functionResponse\": {\n \"name\": \"get_current_weather\",\n | ||
\ \"response\": {\n \"content\": \"{\\\"temperature\\\": | ||
35, \\\"unit\\\": \\\"C\\\"}\"\n }\n }\n },\n {\n | ||
\ \"functionResponse\": {\n \"name\": \"get_current_weather\",\n | ||
\ \"response\": {\n \"content\": \"{\\\"temperature\\\": | ||
25, \\\"unit\\\": \\\"C\\\"}\"\n }\n }\n }\n ]\n | ||
\ }\n ],\n \"tools\": [\n {\n \"functionDeclarations\": [\n {\n | ||
\ \"name\": \"get_current_weather\",\n \"description\": \"Get | ||
the current weather in a given location\",\n \"parameters\": {\n \"type\": | ||
6,\n \"properties\": {\n \"location\": {\n \"type\": | ||
1,\n \"description\": \"The location for which to get the weather. | ||
It can be a city name, a city name and state, or a zip code. Examples: 'San | ||
Francisco', 'San Francisco, CA', '95616', etc.\"\n }\n },\n | ||
\ \"propertyOrdering\": [\n \"location\"\n ]\n | ||
\ }\n }\n ]\n }\n ]\n}" | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '1731' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- python-requests/2.32.3 | ||
x-goog-api-client: | ||
- model-builder/1.79.0+top_google_constructor_method+vertexai.generative_models.GenerativeModel.generate_content | ||
gl-python/3.11.9 grpc/1.68.1 gax/2.23.0 gapic/1.79.0+top_google_constructor_method+vertexai.generative_models.GenerativeModel.generate_content | ||
x-goog-request-params: | ||
- model=projects/fake-project/locations/us-central1/publishers/google/models/gemini-2.5-pro | ||
method: POST | ||
uri: https://us-central1-aiplatform.googleapis.com/v1/projects/fake-project/locations/us-central1/publishers/google/models/gemini-2.5-pro:generateContent?%24alt=json%3Benum-encoding%3Dint | ||
response: | ||
body: | ||
string: !!binary | | ||
H4sIAAAAAAAC/91TwU7rMBC89ytWPRcHECdOVG3EqwQFkXJCCBlnSRccb7A3BYT679ghQODAgeM7 | ||
OTueHc+OndcRwBi9Zz8+hNdYxNJwibE62N2bvAM1hqCrhI0v8LHFIEABagqBXAU+QuSxBN3KGp2Q | ||
0ULswEQsldoqyJ8bNBI5Z9NIgn3QxkRREH5ANwHLFcUG5gdCYA8chTxstKVfVQtEWIs04TDLStyg | ||
5QZ9UBVzZVEZrjPquPKSBarcDrnsCW8T1bALbHGn8XwfjalxP2kQLW1Ig14up5erf/lytZhNV/n8 | ||
g1CiaLKJcdUB0IfWbR7JS9OllNbehm4odFZ6V74xao63bbVwd9yrDpT/54z7WbeTvyeXp5f6MzmP | ||
OrBL3bOLfJ6ubHpS3JwuimKxPP4WMdeaOuL3E4acOl5DqUV//g5f+JrLr15lLLel0tRYLXfsa7XZ | ||
U+cxODIpwwL9hgyqY3ToteCMncSYBiel1/ZOSqIDnR/ePhu2o+F6PUpf29EbabJOVcEDAAA= | ||
headers: | ||
Content-Encoding: | ||
- gzip | ||
Content-Type: | ||
- application/json; charset=UTF-8 | ||
Date: | ||
- Tue, 30 Sep 2025 15:27:34 GMT | ||
Server: | ||
- scaffolding on HTTPServer2 | ||
Transfer-Encoding: | ||
- chunked | ||
Vary: | ||
- Origin | ||
- X-Origin | ||
- Referer | ||
WWW-Authenticate: | ||
- Bearer realm="https://accounts.google.com/" | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-XSS-Protection: | ||
- '0' | ||
status: | ||
code: 401 | ||
message: Unauthorized | ||
version: 1 |
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
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.