Hello, I am trying to create a panel in a dashboard counting the number of LLM token utilization. Th...
d
Hello, I am trying to create a panel in a dashboard counting the number of LLM token utilization. The information is sent from the code using langtrace. My traces have a child trace with operation "openai.chat.completions.create". One of the attributes for this sub-trace is "gen_ai.usage.total_tokens". I want to add to a dashboard a panel with sum for attribute. I can sum other attributes, like duration and so on, but when i select the total tokens attribute from the list I always get 0. Here is what I do: new panel (value type) -> select traces -> add filtering criteria for the traces -> 'Select aggregate operator' is sum -> from the dropdow next to it i select the available 'gen_ai.usage.total_tokens' -> Reduce to: Sum of values in timeframe. However the sum is always zero. If i select for example 'durationNano' instead of 'gen_ai.usage.total_tokens' I get something. Any help appreciated. Thank you
v
Can you please check in attributes in trace details to ensure if gen_ai.usage.total_tokens has non zero value?
d
gen_ai.usage.total_tokens has non zero values, I am able to aggregate if I remove some filters for the trace. The issue I was facing was due to me filtering based a parent trace attribute. Is it possible to filter based on a parent attribute? what would be a good work around for that?