Skip to content

Conversation

@realark
Copy link
Collaborator

@realark realark commented Nov 20, 2025

No description provided.

@realark realark changed the title Ark/gemini instrumentation Instrumentation for Gemini via Google GenAIClient library Nov 20, 2025
@realark realark added the enhancement New feature or request label Nov 20, 2025
@realark realark force-pushed the ark/gemini-instrumentation branch 6 times, most recently from eed887d to 53685c4 Compare November 21, 2025 21:50
@realark realark marked this pull request as ready for review November 21, 2025 22:07
@realark realark force-pushed the ark/gemini-instrumentation branch from 53685c4 to 2bf5b19 Compare November 21, 2025 22:08
var requestJson = JSON_MAPPER.readValue(requestBody, Map.class);

// Extract metadata fields
for (String field :
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my recommendation is to pass the literal input and output to the span. at rest it'll look liek

Image

(ref)

you may find that the ui will automatically render java produced spans automatically

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, I'd much rather do that (or even better just send the entire request/response body and let the backend sort it out)

I think we need to update the backend to support otel here? I tried just sending the input contents directly on both braintrust.input and braintrust.input_json but the BE doesn't recognize that as an LLM message (I just get raw json/yaml views)

}

span.setAttribute(
"braintrust.input_json", JSON_MAPPER.writeValueAsString(inputJson));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know that it'll be a little different since we're using otel ingestion, but it should be the same thing if we just make sure the input is literal input and so on.

@realark realark force-pushed the ark/gemini-instrumentation branch from 2bf5b19 to 4312cd2 Compare November 25, 2025 01:57
@realark
Copy link
Collaborator Author

realark commented Nov 25, 2025

Talked offline: plan is to update the backend to support parsing gemini messages. Once that is in place I'll update this instrumentation to use that simpler approach, but in the meantime I'm going to merge this in to get gemini support into the SDK.

@realark realark merged commit c76aa52 into main Nov 25, 2025
1 check passed
@realark realark deleted the ark/gemini-instrumentation branch November 25, 2025 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants