google / google/adk-python

feat: Add telemetry traces to callbacks

オープン
#2,354 コメント 1 件 リアクション 0 件 担当者 1 名 @Jacksunwei が担当を希望しています GitHub で見る
needs review tracing
主要言語
Python
スター
21.5k
フォーク
4k
平均マージ
1日 14時間
マージ済み PR(30日)
37

説明

**Is your feature request related to a problem? Please describe.**
We are developing an application in a highly regulated industry and need to implement strong guardrails in the form of callbacks. We need to understand the latency of our guardrails to optimize them and provide a great user experience. The current implementation of telemetry in the package seems to package up the callback tracing inside the outer agent run. So I can only infer the total time of all callbacks.

**Describe the solution you'd like**
Each callback should be traced and appear separately in the trace UI. I believe this would be a trace_callback function in https://github.com/google/adk-python/blob/main/src/google/adk/telemetry.py

**Describe alternatives you've considered**
I can use a third-party logging tool like logfire or opentelemetry-instrumentation-google-genai to add spans to each of the callbacks but it would be much better if this were built in.

**Additional context**
Callbacks are not broken out:
Image

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。