Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert Langfuse SpanHandler PR #15492

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
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: 0 additions & 29 deletions docs/docs/module_guides/observability/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,35 +164,6 @@ set_global_handler("literalai")

![](../../_static/integrations/literal_ai.gif)

### Langfuse Span Handler

[Langfuse](https://langfuse.com/docs) is an open source LLM engineering platform to help teams collaboratively debug, analyze and iterate on their LLM Applications. With the Langfuse integration, you can seamlessly track and monitor performance, traces, and metrics of your LlamaIndex application. Detailed traces of the LlamaIndex context augmentation and the LLM querying processes are captured and can be inspected directly in the Langfuse UI.

LlamaIndex provides a span handler for [Langfuse](https://langfuse.com/) which uses the instrumentation API instead of the legacy `CallbackManager`. To get started, [sign up](https://cloud.langfuse.com/auth/sign-up) and create a new project on Langfuse, then obtain an API key.

#### Usage Pattern

First install the Langfuse callback manager.

```
$ pip install llama-index-callbacks-langfuse
```

Then, create a span handler instance and add it to the dispatcher.

```py
import llama_index.core.instrumentation as inst
from llama_index.callbacks.langfuse import LangfuseSpanHandler

langfuse_span_handler = LangfuseSpanHandler(
public_key="<Your public key>",
secret_key="<Your secret key>",
host="<Host URL>",
)
dispatcher = inst.get_dispatcher()
dispatcher.add_span_handler(langfuse_span_handler)
```

## Other Partner `One-Click` Integrations (Legacy Modules)

These partner integrations use our legacy `CallbackManager` or third-party calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
#### Usage Pattern

```python
import llama_index.core.instrumentation as inst
from llama_index.callbacks.langfuse import LangfuseSpanHandler
from llama_index.core import set_global_handler

langfuse_span_handler = LangfuseSpanHandler(
public_key="<Your public key>",
secret_key="<Your secret key>",
host="<Host URL>",
)
dispatcher = inst.get_dispatcher()
dispatcher.add_span_handler(langfuse_span_handler)
# Make sure you've installed the 'llama-index-callbacks-langfuse' integration package.

# NOTE: Set your environment variables 'LANGFUSE_SECRET_KEY', 'LANGFUSE_PUBLIC_KEY' and 'LANGFUSE_HOST'
# as shown in your langfuse.com project settings.

set_global_handler("langfuse")
```

![langfuse-tracing](https://static.langfuse.com/llamaindex-langfuse-docs.gif)
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from llama_index.callbacks.langfuse.base import langfuse_callback_handler
from llama_index.callbacks.langfuse.langfuse_instrumentation import LangfuseSpanHandler

__all__ = ["langfuse_callback_handler", "LangfuseSpanHandler"]
__all__ = ["langfuse_callback_handler"]
Loading
Loading