Skip to content

Google GenAI SDK instrumentation fails to populate "finish_reasons" in the span #3416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
michaelsafyan opened this issue Apr 10, 2025 · 1 comment · Fixed by #3417
Closed
Labels
bug Something isn't working

Comments

@michaelsafyan
Copy link
Contributor

Describe your environment

Reproduces in any environment.

What happened?

The "gen_ai.response.finish_reasons" attribute is present in the span, but is empty. The "gen_ai.choice" event that is emitted shows clearly that there was a "finish_reason" present.

For example, the "finish_reason" in the "gen_ai.choice" event is "STOP", but the "gen_ai.response.finish_reasons" span attribute is [].

Steps to Reproduce

Simply execute the instrumentation such as using the example.

Expected Result

Finish reason on the span should match what was recorded in the choice event.

Actual Result

Always empty.

Additional context

I have an in-flight pull request to fix. (Please assign issue to me).

Recording the bug report, though, to provide clearer rationale for the change.

Would you like to implement a fix?

Yes

@michaelsafyan
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant