feat: Add telemetry traces to callbacks
- Langage dominant
- Python
- Étoiles
- 21.5k
- Forks
- 4k
- Merge moyen
- 1 j 14 h
- PR mergées (30 j)
- 37
Description
**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:
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.