Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,35 @@ export GOFLAGS="-toolexec='orchestrion toolexec'"
go build ./...
```

**4. Initialize OpenTelemetry and Braintrust in your application:**
```go
import (
"context"
"log"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/sdk/trace"
"github.com/braintrustdata/braintrust-sdk-go"
)

func main() {
ctx := context.Background()

// Set up OpenTelemetry tracer
tp := trace.NewTracerProvider()
defer tp.Shutdown(ctx)
otel.SetTracerProvider(tp)

// Initialize Braintrust (registers the exporter)
_, err := braintrust.New(tp, braintrust.WithProject("my-project"))
if err != nil {
log.Fatal(err)
}

// Your LLM calls are now automatically traced
}
```

That's it! Your LLM client calls are now automatically traced. No middleware or wrapper code needed in your application.

### Manual Instrumentation
Expand Down