google / google/adk-python

feat: Add telemetry traces to callbacks

Aperta
#2,354 1 commento 0 reazioni 1 assegnatario Rivendicata da @Jacksunwei Vedi su GitHub
needs review tracing
Lingua principale
Python
Stelle
21.5k
Fork
4k
Merge medio
1g 14h
PR unite (30g)
37

Descrizione

**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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.