Conversation
Add a library to help trace Google's Agent Development Kit. The built in tracing is not consistent, google/adk-go#479, so implement our own tracing and also skip exporting the built in traces to Braintrust. Since ADK already has callbacks at every stage, it should be easy to add tracing, we just have to do some manual bookkeeping in order to set the parent and child relationships correctly because ADK is not doing that natively by passing around contexts in that way. Also added an example script based on the adk library's examples, though I modified it a bit because the base example never exits cleanly, which breaks some tracing. The new version uses ctrl+c to cleanly exit. Add traceadk Drop native ADK spans Fix agent/model tracing
Let the server handle this format instead. Do remove empty values, though, rather than unnecessarily storing them.
Matt Perpick (clutchski)
left a comment
There was a problem hiding this comment.
Great stuff. We also need auto instrumentation!
* Remove binary file * API changes * Update traceadk_test.go to use real ADK library with VCR * Add autoinstrumentation with orchestrion
This can double the size of the payload, which can be particularly bad for tests like ones with images.
| module github.com/braintrustdata/braintrust-sdk-go | ||
|
|
||
| go 1.24.0 | ||
| go 1.24.4 |
There was a problem hiding this comment.
do we need this? maybe just curious. it's changing the minimum version required.
There was a problem hiding this comment.
discussed offline, but turns out adk-go's minimum support go version is 1.24.0, even for the very first release of adk-go
* Move parallel adk example into proper directory * Rename DropAdkTraces to EnableBuiltinAdkTraces (and reverse the meaning) * Simplify ADK examples
| Instruction: "You are a helpful assistant that helps users with various tasks. You can tell the current time in any timezone using the get_time tool.", | ||
| Tools: []tool.Tool{timeTool}, | ||
| } | ||
| traceadk.AddLLMAgentCallbacks(&cfg) |
Matt Perpick (clutchski)
left a comment
There was a problem hiding this comment.
a few changes requested.
we need auto instrumentation before merging. i dont want to have to document exceptions ... "we have autoinstrumentation but not for go-adk".
it's very easy to do / test.
This change does have auto instrumentation, like https://github.com/braintrustdata/braintrust-sdk-go/pull/37/files#diff-81730da075f184826fbcd61855b55bab6ac24206836896709cfebcedc1f42442? Example trace from running that: https://www.braintrust.dev/app/braintrustdata.com/p/go-sdk-examples/logs?r=da45b08774a5c8a05adb2da51f7e940e&s=2a74b6d947cec316 (my openai and anthropic keys may not be working if you see issues in those spans) |
Add a library to help trace Google's Agent Development Kit. The built in tracing is not consistent, google/adk-go#479, so implement our own tracing and also skip exporting the built in traces to Braintrust. Since ADK already has callbacks at every stage, it should be easy to add tracing, we just have to do some manual bookkeeping in order to set the parent and child relationships correctly because ADK is not doing that natively by passing around contexts in that way.
Also added an example script based on the adk library's examples, though I modified it a bit because the base example never exits cleanly, which breaks some tracing. The new version uses ctrl+c to cleanly exit.