You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect mapping in telemetry usage attributes #2105
Incorrect mapping in telemetry usage attributes. The gen_ai.usage.output_tokens was
incorrectly mapped to llm_response.usage_metadata.total_token_count instead of
llm_response.usage_metadata.candidates_token_count, leading to wrong output token counts in
Langfuse integration.
gen_ai.usage.output_tokens should correctly map to candidates_token_count for accurate
output token tracking in Langfuse.
Screenshots
shows incorrect output token counts in Langfuse usage details due to wrong
attribute mapping.
Desktop (please complete the following information):
OS: Linux Ubuntu 22.04
Python version: 3.12.3
ADK version: 1.7.0
Model Information:
Affects all models integrated with Langfuse
Additional context
Can be fixed by changing the mapping from llm_response.usage_metadata.total_token_count to
llm_response.usage_metadata.candidates_token_count for the gen_ai.usage.output_tokens
attribute in telemetry.py
Activity
fix: Fix incorrect token count mapping in telemetry
fix: Fix incorrect token count mapping in telemetry
fix: Fix incorrect token count mapping in telemetry
fix: Fix incorrect token count mapping in telemetry