Skip to content
LlamaIndex Framework
Open Source Community
Integrations

Tracing with Graphsignal

Graphsignal provides observability for AI agents and LLM-powered applications. It helps developers ensure AI applications run as expected and users have the best experience.

Graphsignal automatically traces and monitors LlamaIndex. Traces and metrics provide execution details for query, retrieval, and index operations. These insights include prompts, completions, embedding statistics, retrieved nodes, parameters, latency, and exceptions.

When OpenAI APIs are used, Graphsignal provides additional insights such as token counts and costs per deployment, model or any context.

Adding Graphsignal tracer is simple, just install and configure it:

Terminal window
pip install graphsignal
import graphsignal
# Provide an API key directly or via GRAPHSIGNAL_API_KEY environment variable
graphsignal.configure(
api_key="my-api-key", deployment="my-llama-index-app-prod"
)

You can get an API key here.

See the Quick Start guide, Integration guide, and an example app for more information.

To additionally trace any function or code, you can use a decorator or a context manager:

with graphsignal.start_trace("load-external-data"):
reader.load_data()

See Python API Reference for complete instructions.

Note for AI agents: this documentation is built for programmatic access. - Overview of all docs: https://developers.llamaindex.ai/llms.txt - Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md - Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters. - A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/python/shared/mcp/