-
Notifications
You must be signed in to change notification settings - Fork 43
Use LogRecord.event_name to set the log ID when the gcp log name attribute is not present.
#417
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
DylanRussell
merged 12 commits into
GoogleCloudPlatform:main
from
DylanRussell:logname_change
Oct 6, 2025
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
27f602b
Initial commit to handle event name attr key
DylanRussell 651ef93
Update logic to set log name
DylanRussell 779896f
Edit changelog
DylanRussell 7039e2c
Run precommit
DylanRussell eba8551
fix mypy.. and setup constraints
DylanRussell fab20c9
Fix install requires block again
DylanRussell 408d1a3
Merge branch 'main' into logname_change
DylanRussell 00bd01e
Merge branch 'main' into logname_change
DylanRussell 26d416d
Update code to validate log id and name
DylanRussell 64a21a2
Fix lint and broke test
DylanRussell 2c864c6
use event.name instead of event_name
DylanRussell eefa082
fix mypy issue
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
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
93 changes: 93 additions & 0 deletions
93
...exporter-gcp-logging/tests/__snapshots__/test_cloud_logging/test_convert_gen_ai_body.json
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,93 @@ | ||
| [ | ||
| { | ||
| "entries": [ | ||
| { | ||
| "jsonPayload": { | ||
| "gen_ai.input.messages": [ | ||
| { | ||
| "parts": [ | ||
| { | ||
| "content": "Get weather details in New Delhi and San Francisco?", | ||
| "type": "text" | ||
| } | ||
| ], | ||
| "role": "user" | ||
| }, | ||
| { | ||
| "parts": [ | ||
| { | ||
| "arguments": { | ||
| "location": "New Delhi" | ||
| }, | ||
| "id": "get_current_weather_0", | ||
| "name": "get_current_weather", | ||
| "type": "tool_call" | ||
| }, | ||
| { | ||
| "arguments": { | ||
| "location": "San Francisco" | ||
| }, | ||
| "id": "get_current_weather_1", | ||
| "name": "get_current_weather", | ||
| "type": "tool_call" | ||
| } | ||
| ], | ||
| "role": "model" | ||
| }, | ||
| { | ||
| "parts": [ | ||
| { | ||
| "id": "get_current_weather_0", | ||
| "response": { | ||
| "content": "{\"temperature\": 35, \"unit\": \"C\"}" | ||
| }, | ||
| "type": "tool_call_response" | ||
| }, | ||
| { | ||
| "id": "get_current_weather_1", | ||
| "response": { | ||
| "content": "{\"temperature\": 25, \"unit\": \"C\"}" | ||
| }, | ||
| "type": "tool_call_response" | ||
| } | ||
| ], | ||
| "role": "user" | ||
| } | ||
| ], | ||
| "gen_ai.output.messages": [ | ||
| { | ||
| "finish_reason": "stop", | ||
| "parts": [ | ||
| { | ||
| "content": "The current temperature in New Delhi is 35°C, and in San Francisco, it is 25°C.", | ||
| "type": "text" | ||
| } | ||
| ], | ||
| "role": "model" | ||
| } | ||
| ], | ||
| "gen_ai.system_instructions": [ | ||
| { | ||
| "content": "You are a clever language model", | ||
| "type": "text" | ||
| } | ||
| ] | ||
| }, | ||
| "labels": { | ||
| "event.name": "gen_ai.client.inference.operation.details" | ||
| }, | ||
| "logName": "projects/fakeproject/logs/gen_ai.client.inference.operation.details", | ||
| "resource": { | ||
| "labels": { | ||
| "location": "global", | ||
| "namespace": "", | ||
| "node_id": "" | ||
| }, | ||
| "type": "generic_node" | ||
| }, | ||
| "timestamp": "2025-01-15T21:25:10.997977393Z" | ||
| } | ||
| ], | ||
| "partialSuccess": true | ||
| } | ||
| ] |
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
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.