Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tracing usage.total_token_count as 'output_tokens' #1995

@avivguardz

Description

@avivguardz

span.set_attribute(
'gen_ai.usage.output_tokens',
llm_response.usage_metadata.total_token_count,
)

'usage_metadata.total_token_count' is set as 'output_tokens' which is very confusing.
I'm not sure if this is a bug or intentional but either way, total tokens should be set as 'total_tokens' or 'candidates_token_count' should be set as 'output_tokens'.

Metadata

Metadata

Assignees

Labels

bot triaged[Bot] This issue is triaged by ADK bottracing[Component] This issue is related to OpenTelemetry tracing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions