@@ -8,26 +8,26 @@ import { trace } from "@opentelemetry/api";
88dotenv . config ( ) ;
99
1010async function main ( ) {
11- // 1. Start the OTel SDK with GalileoSpanProcessor
11+ // Start the OTel SDK with GalileoSpanProcessor
1212 const sdk = new NodeSDK ( {
1313 spanProcessors : [ new GalileoSpanProcessor ( ) ] ,
1414 sampler : new AlwaysOnSampler ( ) ,
1515 } ) ;
1616 sdk . start ( ) ;
1717
18- // 2. Use the tracer to create spans
18+ // Use the tracer to create spans
1919 const tracer = trace . getTracer ( "my-app" ) ;
2020
2121 tracer . startActiveSpan ( "my-workflow" , async ( span ) => {
2222
23- // Simulate some work (e.g., an LLM call)
23+ // Simulate a tool call
2424
2525 span . setAttribute ( "gen_ai.operation.name" , "execute_tool" )
2626 span . setAttribute ( "gen_ai.tool.name" , "get_weather" )
2727 span . setAttribute ( "gen_ai.tool.type" , "function" )
2828
29- span . setAttribute ( "gen_ai.tool.call.arguments" , '{"city":"SF"}' )
30- span . setAttribute ( "gen_ai.tool.call.result" , '{"temp_f":68}' )
29+ span . setAttribute ( "gen_ai.tool.call.arguments" , '{"city":"SF"}' ) // sends to Galileo's "Input" column
30+ span . setAttribute ( "gen_ai.tool.call.result" , '{"temp_f":68}' ) // sends to Galileo's "Output" column
3131
3232 span . end ( ) ;
3333 } ) ;
0 commit comments