Skip to content

Commit f93bc63

Browse files
Migrate google GenAi instrumentation to use the GenAi utils package (#10)
* Migrate google GenAi instrumentation to use the GenAi utils package * Apply fixes * Upade changelog and add assertion to test.. * Fix tests, tool argument / result serialization * Remove some code moved to utils * Add comments explaining serialization * Fix tests and merge main * update changelog * Fix broken CI --------- Co-authored-by: Liudmila Molkova <neskazu@gmail.com>
1 parent 258a3ce commit f93bc63

8 files changed

Lines changed: 465 additions & 1132 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refactor code to make use of the shared GenAi Utils package `opentelemetry-util-genai`. This shared package is used by multiple GenAI instrumentations, and ensures sem convs are followed and up to date. This does result in some span attributes on the `execute_tool` span being removed (`code.function.parameters.someparam.type`, `code.function.parameters.someparam.value` etc.), and other sem conv compliant attributes being added to the span (specifically: `gen_ai.tool.call.arguments`, `gen_ai.tool.call.result`), it also correctly changes the `SpanKind` from `INTERNAL` to `CLIENT`. The `generate_content` span also is switched to `SpanKind` `CLIENT`, and the `gen_ai.provider.name` attribute which was missing has been added, it's value is `vertex_ai`. The `InstrumentationScope` of the log and trace will also change, as the `TelemetryHandler` class in the utils package is now used to write the logs and traces.

0 commit comments

Comments
 (0)