Skip to content

Commit e8d40d6

Browse files
committed
update code and readme
1 parent 863974f commit e8d40d6

6 files changed

Lines changed: 511 additions & 434 deletions

File tree

typescript/otel/basic-example/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ Run the basic example:
2727
npm install
2828
npm start run
2929
```
30+
31+
## View in the Galileo console
32+
33+
Confirm that you're able to view logged traces in the Galileo console.
34+
35+
![Logged traces in Galileo](screenshot-traces-table.png)
36+
37+
![Messages page in Galileo](screenshot-messages-page.png)
38+

typescript/otel/basic-example/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ import { trace } from "@opentelemetry/api";
88
dotenv.config();
99

1010
async 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

Comments
 (0)