|
| 1 | +--- |
| 2 | +description: Integrate goose with Laminar to observe performance |
| 3 | +--- |
| 4 | + |
| 5 | +# Observability with Laminar |
| 6 | + |
| 7 | +This tutorial covers how to integrate goose with Laminar to trace your goose sessions and understand how the agent is performing. |
| 8 | + |
| 9 | +## What is Laminar |
| 10 | + |
| 11 | +[Laminar](https://laminar.sh/) is an open-source observability platform purpose-built for AI agents. It traces LLM calls, tool execution, and custom functions so you can debug, evaluate, and improve agent behavior. |
| 12 | + |
| 13 | +## Why Laminar for goose |
| 14 | + |
| 15 | +- High-signal traces for LLM calls, tools, and sub-agents. |
| 16 | +- Replay any span in the Playground to compare prompts and models. |
| 17 | +- Build datasets from production traces and run evaluations. |
| 18 | +- Analyze trace patterns with natural language queries and dashboards. |
| 19 | + |
| 20 | +## Set up Laminar |
| 21 | + |
| 22 | +Sign up for Laminar Cloud at [laminar.sh](https://laminar.sh) or self-host Laminar from the [open-source repo](https://github.com/lmnr-ai/lmnr). Grab your project API key. |
| 23 | + |
| 24 | +## Configure goose to export OTLP to Laminar |
| 25 | + |
| 26 | +goose exports OpenTelemetry data over OTLP/HTTP. Point the exporter to Laminar and provide your API key as an authorization header. |
| 27 | + |
| 28 | +### Laminar Cloud |
| 29 | + |
| 30 | +```bash |
| 31 | +export LMNR_PROJECT_API_KEY=lmnr_proj_... |
| 32 | +export OTEL_EXPORTER_OTLP_ENDPOINT="https://api.lmnr.ai" |
| 33 | +export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer ${LMNR_PROJECT_API_KEY}" |
| 34 | +export OTEL_EXPORTER_OTLP_TIMEOUT=10000 |
| 35 | +``` |
| 36 | + |
| 37 | +### Self-hosted Laminar |
| 38 | + |
| 39 | +```bash |
| 40 | +export LMNR_PROJECT_API_KEY=lmnr_proj_... |
| 41 | +export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:8000" |
| 42 | +export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer ${LMNR_PROJECT_API_KEY}" |
| 43 | +``` |
| 44 | + |
| 45 | +If your self-hosted instance does not require auth, you can omit `OTEL_EXPORTER_OTLP_HEADERS`. |
| 46 | + |
| 47 | +:::tip |
| 48 | +If you do not see traces, try setting the endpoint to the explicit OTLP path, such as `https://api.lmnr.ai/v1/traces` or `http://localhost:8000/v1/traces`. |
| 49 | +::: |
| 50 | + |
| 51 | +## Run goose with Laminar enabled |
| 52 | + |
| 53 | +Start goose normally. With the OTLP environment variables set, Laminar will capture traces of your goose sessions and tool execution. |
| 54 | + |
| 55 | +_[Example trace (public) in Laminar](https://laminar.sh/shared/traces/63010af0-cf31-b8b6-0d77-fc9924bcaa4c)_ |
| 56 | + |
| 57 | + |
0 commit comments