From a04b5287982bf4d95657bd7fd4a7f19d89f7959b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Maierh=C3=B6fer?= <48529566+jannikmaierhoefer@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:37:14 +0100 Subject: [PATCH] docs: add langfuse observability guide (#1047) Co-authored-by: angiejones --- documentation/docs/tutorials/langfuse.md | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 documentation/docs/tutorials/langfuse.md diff --git a/documentation/docs/tutorials/langfuse.md b/documentation/docs/tutorials/langfuse.md new file mode 100644 index 00000000..e970de38 --- /dev/null +++ b/documentation/docs/tutorials/langfuse.md @@ -0,0 +1,40 @@ +--- +description: Integrate Goose with Langfuse to observe performance +--- + +# Observability with Langfuse + +This tutorial covers how to integrate Goose with Langfuse to monitor your Goose requests and understand how the agent is performing. + +## What is Langfuse + +[Langfuse](https://langfuse.com/) is an [open-source](https://github.com/langfuse/langfuse) LLM engineering platform that enables teams to collaboratively monitor, evaluate, and debug their LLM applications. + + +## Set up Langfuse + +Sign up for Langfuse Cloud [here](https://cloud.langfuse.com) or self-host Langfuse [Docker Compose](https://langfuse.com/self-hosting/local) to get your Langfuse API keys. + +## Configure Goose to Connect to Langfuse + +Set the environment variables so that Goose (written in Rust) can connect to the Langfuse server. + +```bash +export LANGFUSE_INIT_PROJECT_PUBLIC_KEY=pk-lf-... +export LANGFUSE_INIT_PROJECT_SECRET_KEY=sk-lf-... +export LANGFUSE_HOST=https://cloud.langfuse.com # EU data region πŸ‡ͺπŸ‡Ί + +# https://us.cloud.langfuse.com if you're using the US region πŸ‡ΊπŸ‡Έ +# https://localhost:3000 if you're self-hosting +``` + +## Run Goose with Langfuse Integration + +Now, you can run Goose and monitor your AI requests and actions through Langfuse. + +With Goose running and the environment variables set, Langfuse will start capturing traces of your Goose activities. + +_[Example trace (public) in Langfuse](https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/traces/cea4ed38-0c44-4b0a-8c20-4b0b6b9e8d73?timestamp=2025-01-31T15%3A52%3A30.362Z&observation=7c8e5807-3c29-4c28-9c6f-7d7427be401f)_ + +![Goose trace in Langfuse](https://langfuse.com//images/docs/goose-integration/goose-example-trace.png) +