Commit c17e428
Update google genai instrumentation to work with latest semantic convention, allow for uploading content. (#3772)
* Update google genai instrumentation to latest semantic convention.
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
* fix: log roles as str, event attrs as objects.
* fix: proper event name
* refactor: remove unused message models.
* refactor: use OTel imported semconv attributes.
* refactor: Inject upload_hook in Instrumentor.
* refactor: rename upload hook to completion hook.
* test: add tests for non streaming case and tool_call_wrapper.
* test: add tool call instrumentation tests and nonstreaming recording in spans test.
* fix: remove print
* feature: add blobpart and filepart to message handling
* fix: encode bytes as base64 when dumping to json string.
* fix: always call completion hook, independently of recording settings.
* test: update requirements for instrumentation-google-genai oldest env
* test: bump google-genai lib version in -oldest test env.
* test: fix event recording test.
* Update FakeCredentials
* Fix tests
* fix lint issues
* fix: aggregate streaming messages into one event.
* fix: remove gen_ai.system from latest sem_conv
* refactor: import encoder from utils-genai
* build: update deps versions.
* refactor: deduplicate creating attributes, use gen_ai_json_dumps
* refactor: move blobpart and filedatapart to instrumentation-google-genai package.
* test: add comment for headers.
* test: fix span attributes formatting.
* fix: lint
* fix: use LogRecord instead of Event.
* docs: update changelog
* build: update uv.lock
* test: disable lint
* build: unpin opentelemetry-util-genai version
* test: add e2e completion_hook test
---------
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
Co-authored-by: Dylan Russell <dylanrus@gmail.com>
Co-authored-by: DylanRussell <DylanRussell@users.noreply.github.com>1 parent 5fdc5d5 commit c17e428
File tree
36 files changed
+2399
-901
lines changed- instrumentation-genai/opentelemetry-instrumentation-google-genai
- src/opentelemetry/instrumentation/google_genai
- tests
- common
- generate_content
- cassettes
- utils
36 files changed
+2399
-901
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | | - | |
23 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments