Back to Opik

Observability Overview

apps/opik-documentation/documentation/fern/docs-v2/observability/overview.mdx

2.0.22-6605-merge-20656.1 KB
Original Source
<Tip> If you want to jump straight to code, head to the [Getting started](/tracing/getting-started) guide to add tracing in under five minutes. </Tip>

LLM applications are more than a single API call. A typical agent involves retrieval steps, tool calls, prompt assembly, multiple LLM invocations, and post-processing — all wired together in ways that are invisible at runtime. When something goes wrong, you need to see exactly what happened at every step.

Opik gives you full visibility into every request your agent handles. Every LLM call, every tool invocation, every retrieval step is captured as a trace you can inspect, search, and analyze.

<Frame> </Frame>

Why use Opik for observability

Debugging LLM applications without observability means guessing. You see the final output but not why the model hallucinated, which retrieval step returned irrelevant context, or where latency spiked.

With Opik, you can:

  • See the full execution path of every request — from user input through tool calls and LLM completions to the final response
  • Root-cause production issues fast — filter and search traces by status, latency, cost, or custom tags to find the problem in seconds
  • Track costs and latency over time — monitor token usage and spending across models and providers
  • Capture multi-turn conversations — group related traces into threads to understand how interactions evolve across turns
  • Close the feedback loop — attach human or automated scores to traces and use them to drive evaluations

What you can capture

<CardGroup cols={3}> <Card title="Traces & spans" href="/tracing/concepts" icon="fa-regular fa-diagram-project"> Full execution trees with inputs, outputs, timing, and metadata for every step </Card> <Card title="Conversations" href="/tracing/advanced/log_chat_conversations" icon="fa-regular fa-comments"> Multi-turn threads that group related traces into coherent sessions </Card> <Card title="Cost tracking" href="/tracing/advanced/cost_tracking" icon="fa-regular fa-dollar-sign"> Token usage and spending broken down by model, provider, and trace </Card> <Card title="Media & attachments" href="/tracing/advanced/log_multimodal_traces" icon="fa-regular fa-image"> Images, audio, video, and files logged alongside your traces </Card> <Card title="User feedback" href="/tracing/advanced/annotate_traces" icon="fa-regular fa-thumbs-up"> Qualitative and quantitative scores attached to individual traces </Card> <Card title="Agent graphs" href="/tracing/advanced/log_agent_graphs" icon="fa-regular fa-share-nodes"> Visual execution graphs showing how your agent's steps connect </Card> </CardGroup>

How it works

<Steps> <Step title="Connect your project"> Run `opik connect` from your agent's directory to pair it with Opik:
```bash
opik connect --project <YOUR_PROJECT_NAME>
```
</Step> <Step title="Instrument your code"> The fastest way to add tracing is with [opik-skills](https://github.com/comet-ml/opik-skills) — install the skill and let your coding agent handle the rest:
```bash
npx skills add comet-ml/opik-skills
```

Then ask your coding agent:

```
Instrument my agent with Opik using the /instrument command.
```

This works with Claude Code, Cursor, Codex, OpenCode, and other coding agents. You can also instrument manually with the SDK:

<CodeBlocks>
  ```python title="Python"
  import opik

  @opik.track
  def my_agent(user_message):
      context = retrieve_context(user_message)
      response = call_llm(user_message, context)
      return response
  ```

  ```ts title="TypeScript"
  import { Opik } from "opik";
  const client = new Opik();

  const myAgent = client.track({
    name: "my-agent",
    fn: async (userMessage: string) => {
      const context = await retrieveContext(userMessage);
      return await callLlm(userMessage, context);
    },
  });
  ```
</CodeBlocks>
</Step> <Step title="View traces in the dashboard"> Every request creates a trace with detailed span-level information. You can inspect the full execution tree, see inputs and outputs at each step, and filter by duration, cost, status, or tags.
<Frame>
  
</Frame>
</Step> <Step title="Analyze and improve"> Use traces to debug failures, identify slow steps, and track quality over time. Attach feedback scores, run evaluations against datasets, and use [Ollie](/tracing/debug-agents) — Opik's AI assistant — to help root-cause issues automatically. </Step> </Steps>

Integrations

Opik has first-class support for 30+ frameworks in Python, TypeScript, and OpenTelemetry — so you can start capturing traces without changing how your application is built.

<CardGroup cols={3}> <Card title="LangChain" href="/integrations/langchain" icon={} iconPosition="left"/> <Card title="LlamaIndex" href="/integrations/llama_index" icon={} iconPosition="left"/> <Card title="Anthropic" href="/integrations/anthropic" icon={} iconPosition="left"/> <Card title="AWS Bedrock" href="/integrations/bedrock" icon={} iconPosition="left"/> <Card title="Google Gemini" href="/integrations/gemini" icon={} iconPosition="left"/> <Card title="CrewAI" href="/integrations/crewai" icon={} iconPosition="left"/> </CardGroup>

View all integrations →

Next steps