Files
comet-ml--opik/apps/opik-documentation/documentation/fern/docs-v2/observability/getting-started.mdx
T
wehub-resource-sync 5a558eb09e
TypeScript SDK Compatibility V1.x E2E Tests / Select Node version matrix (push) Has been cancelled
TypeScript SDK Compatibility V1.x E2E Tests / TypeScript SDK Compatibility V1.x E2E Tests Node ${{matrix.node_version}} (push) Has been cancelled
TypeScript SDK E2E Tests / TypeScript SDK E2E Tests Node ${{matrix.node_version}} (push) Has been cancelled
Opik Optimizer - E2E Tests / build-opik (push) Has been cancelled
TypeScript SDK Compatibility V1.x E2E Tests / build-opik (push) Has been cancelled
Python SDK E2E Tests / Select Python version matrix (push) Has been cancelled
Python SDK E2E Tests / Python SDK E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Python SDK E2E Tests / build-opik (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / Select Python version matrix (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / Python SDK Compatibility V1.x E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / build-opik (push) Has been cancelled
TypeScript SDK E2E Tests / Select Node version matrix (push) Has been cancelled
TypeScript SDK E2E Tests / build-opik (push) Has been cancelled
Opik Optimizer - E2E Tests / Opik Optimizer E2E Tests Python ${{matrix.python_version}} (push) Has been cancelled
Opik Optimizer - E2E Tests / Opik Optimizer Integration Smoke Tests (push) Has been cancelled
🐙 Code Quality / detect (push) Has been cancelled
🐙 Code Quality / lint (${{ matrix.leg.name }}) (push) Has been cancelled
🐙 Code Quality / summary (push) Has been cancelled
TypeScript SDK Library Integration Tests / Check Secrets (push) Has been cancelled
TypeScript SDK Library Integration Tests / opik-vercel (Vercel AI SDK / eve) (push) Has been cancelled
SDK Library Integration Tests Runner / Check Secrets (push) Has been cancelled
SDK Library Integration Tests Runner / Missed OpenAI API Key Warning (push) Has been cancelled
SDK Library Integration Tests Runner / Build (push) Has been cancelled
SDK Library Integration Tests Runner / openai_tests (push) Has been cancelled
SDK Library Integration Tests Runner / langchain_tests (push) Has been cancelled
SDK Library Integration Tests Runner / langchain_legacy_tests (push) Has been cancelled
SDK Library Integration Tests Runner / llama_index_tests (push) Has been cancelled
SDK Library Integration Tests Runner / anthropic_tests (push) Has been cancelled
SDK Library Integration Tests Runner / mistral_tests (push) Has been cancelled
SDK Library Integration Tests Runner / groq_tests (push) Has been cancelled
SDK Library Integration Tests Runner / aisuite_tests (push) Has been cancelled
SDK Library Integration Tests Runner / haystack_tests (push) Has been cancelled
SDK Library Integration Tests Runner / dspy_tests (push) Has been cancelled
SDK Library Integration Tests Runner / crewai_v0_tests (push) Has been cancelled
SDK Library Integration Tests Runner / crewai_v1_tests (push) Has been cancelled
SDK Library Integration Tests Runner / genai_tests (push) Has been cancelled
SDK Library Integration Tests Runner / adk_tests (push) Has been cancelled
SDK Library Integration Tests Runner / adk_legacy_1_3_0_tests (push) Has been cancelled
SDK Library Integration Tests Runner / evaluation_metrics_tests (push) Has been cancelled
SDK Library Integration Tests Runner / bedrock_tests (push) Has been cancelled
SDK Library Integration Tests Runner / litellm_tests (push) Has been cancelled
SDK Library Integration Tests Runner / harbor_tests (push) Has been cancelled
SDK Library Integration Tests Runner / Slack Notification (push) Has been cancelled
Lint Opik Helm Chart / render-equality (push) Has been cancelled
Opik Optimizer - Unit Tests / Opik Optimizer Unit Tests Python ${{matrix.python_version}} (push) Has been cancelled
Python BE E2E Tests / Python BE E2E (push) Has been cancelled
Python Backend Tests / run-python-backend-tests (push) Has been cancelled
Python SDK Unit Tests / Python SDK Unit Tests ${{matrix.python_version}} (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
SDK E2E Libraries Integration Tests / Check Secrets (push) Has been cancelled
SDK E2E Libraries Integration Tests / Missed OpenAI API Key Warning (push) Has been cancelled
SDK E2E Libraries Integration Tests / build-opik (push) Has been cancelled
SDK E2E Libraries Integration Tests / E2E Lib Integration Python ${{matrix.python_version}} (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-gemini) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-langchain) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-openai) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-otel) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-vercel) (push) Has been cancelled
TypeScript SDK Build & Publish / build-and-publish (push) Has been cancelled
TypeScript SDK Unit Tests / Test on Node ${{ matrix.node-version }} (push) Has been cancelled
Backend Tests / discover-tests (push) Has been cancelled
Backend Tests / ${{ matrix.name }} (push) Has been cancelled
Build and Publish SDK / build-and-publish (push) Has been cancelled
Build Opik Docker Images / set-version (push) Has been cancelled
Build Opik Docker Images / build-backend (push) Has been cancelled
Build Opik Docker Images / build-sandbox-executor-python (push) Has been cancelled
Build Opik Docker Images / build-python-backend (push) Has been cancelled
Build Opik Docker Images / build-frontend (push) Has been cancelled
Build Opik Docker Images / create-git-tag (push) Has been cancelled
ClickHouse Migration Cluster Check / validate-clickhouse-migrations (push) Has been cancelled
Docs - Publish / run (push) Has been cancelled
E2E Tests - Post Merge (v2) / 🧪 E2E v2 Tests (${{ github.event.inputs.tier || 't1' }}) (push) Has been cancelled
E2E Tests - Post Merge (v2) / 📢 Slack Notification (push) Has been cancelled
Frontend Unit Tests / Test on Node 20 (push) Has been cancelled
Guardrails E2E Tests / Select Python version matrix (push) Has been cancelled
Guardrails E2E Tests / Guardrails E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Guardrails E2E Tests / 📢 Slack Notification (push) Has been cancelled
Guardrails Backend Unit Tests / Guardrails Backend Unit Tests (push) Has been cancelled
Guardrails Backend Unit Tests / 📢 Slack Notification (push) Has been cancelled
Lint Opik Helm Chart / lint-helm-chart (Helm v3.21.0) (push) Has been cancelled
Lint Opik Helm Chart / lint-helm-chart (Helm v4.2.0) (push) Has been cancelled
Lint Opik Helm Chart / unittest-helm-chart (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:25:44 +08:00

178 lines
6.2 KiB
Plaintext

---
headline: Getting Started with Observability | Opik Documentation
og:description: Add observability to your LLM application with Opik tracing using
AI-powered skills or manual SDK integration
og:site_name: Opik Documentation
og:title: Getting Started with Observability — Opik
title: Getting started with Observability
---
Opik makes it easy to add observability to your existing LLM application. The fastest way is to let
your coding agent do it — install the Opik skill in Claude Code, Cursor, Codex, or any other
coding agent and it will instrument your code for you. If you'd rather stay inside Opik, use Opik
Connect to have [Ollie](/ollie) set up tracing from the dashboard. You can also add
tracing manually with the SDK.
<video
src="/img/v2/observability/getting-started.mp4"
width="854"
height="480"
autoPlay
muted
loop
playsInline
controls
preload="auto"
/>
## Adding observability to your code
<Tabs>
<Tab title="AI coding agent">
The fastest way to add observability is to install the Opik skill in your coding agent and let
it instrument your code for you. The skill is compatible with Claude Code, Codex, Cursor,
OpenCode and any other agent that supports skills.
<Steps>
<Step title="Install the Opik skill">
```bash
npx skills add comet-ml/opik-skills
```
</Step>
<Step title="Run the integration">
Ask your coding agent to instrument your code:
```
Instrument my agent with Opik using the /instrument command.
```
The agent will read your code, pick the right Opik integration, and add tracing.
</Step>
</Steps>
</Tab>
<Tab title="Opik Connect">
Opik Connect links your local repository to Opik so that [Ollie](/ollie), Opik's
built-in AI coding assistant, can inspect your code and add tracing from the dashboard — no
local agent setup required.
<Steps>
<Step title="Install Opik">
```bash
pip install opik
```
</Step>
<Step title="Set your environment variables">
<Tabs>
<Tab title="Opik Cloud">
```bash
export OPIK_API_KEY="<YOUR_API_KEY>"
export OPIK_WORKSPACE="<YOUR_WORKSPACE>"
```
You can find your API key and workspace name in the [Opik dashboard](https://www.comet.com/opik).
</Tab>
<Tab title="Self-hosted">
```bash
export OPIK_URL_OVERRIDE="http://localhost:5173/api"
```
Replace the URL with your Opik instance address if it differs from the default.
</Tab>
</Tabs>
</Step>
<Step title="Connect your repository">
Run this command in the repository you want Ollie to work in:
```bash
opik connect --project "<YOUR_PROJECT_NAME>"
```
This creates a local connection between Opik and your machine so Ollie can inspect your
code and help add tracing.
</Step>
</Steps>
Once connected, open Opik and Ollie will help you instrument your code and set up tracing.
See the [Ollie documentation](/ollie) for more details.
</Tab>
<Tab title="Manual integration">
Opik has integrations with all the popular Agent frameworks in both Python and TypeScript as well as
first-class support for OpenTelemetry:
<CardGroup cols={3}>
<Card title="LangChain" href="/integrations/langchain" icon={<img src="/img/tracing/langchain.svg" />} iconPosition="left"/>
<Card title="LlamaIndex" href="/integrations/llama_index" icon={<img src="/img/tracing/llamaindex.svg" />} iconPosition="left"/>
<Card title="Anthropic" href="/integrations/anthropic" icon={<img src="/img/tracing/anthropic.svg" />} iconPosition="left"/>
<Card title="AWS Bedrock" href="/integrations/bedrock" icon={<img src="/img/tracing/bedrock.svg" />} iconPosition="left"/>
<Card title="Google Gemini" href="/integrations/gemini" icon={<img src="/img/tracing/gemini.svg" />} iconPosition="left"/>
<Card title="CrewAI" href="/integrations/crewai" icon={<img src="/img/tracing/crewai.svg" />} iconPosition="left"/>
</CardGroup>
**[View all 30+ integrations →](/integrations/overview)**
If your framework is not listed, you can use the `@track` decorator (Python) or `track` wrapper
(TypeScript) to manually instrument your code:
<CodeBlocks>
```python title="Python"
import opik
opik.configure()
@opik.track
def my_llm_call(user_message):
# Your LLM call here
response = call_llm(user_message)
return response
@opik.track(name="my-agent")
def my_agent(user_message):
context = retrieve_context(user_message)
response = my_llm_call(user_message)
return response
```
```ts title="Typescript"
import { Opik } from "opik";
const client = new Opik();
const myLlmCall = client.track({
name: "my_llm_call",
fn: async (userMessage: string) => {
// Your LLM call here
const response = await callLlm(userMessage);
return response;
},
});
const myAgent = client.track({
name: "my-agent",
fn: async (userMessage: string) => {
const context = await retrieveContext(userMessage);
const response = await myLlmCall(userMessage);
return response;
},
});
```
</CodeBlocks>
</Tab>
</Tabs>
## Viewing your traces
After running your application, traces will appear in the Opik dashboard. Each trace captures the
full execution path of a request, including all nested spans, inputs, outputs, and timing information.
<Frame>
<img src="/img/v2/observability/traces-page.png" alt="Opik traces page showing trace details with span tree, outputs, and feedback scores" />
</Frame>
You can use [Ollie](/ollie) to analyze your traces, identify issues in your agent's
behavior, and get actionable suggestions for improvement.
## Next steps
- [Concepts](/tracing/concepts) — Learn about traces, spans, threads, and feedback scores
- [Log traces](/tracing/advanced/log_traces) — In-depth guide on customizing what gets logged
- [Cost tracking](/tracing/advanced/cost_tracking) — Monitor token usage and spending