instrument
Instrument — Add Opik Tracing to a Codebase
You are instrumenting an existing codebase with Opik observability. Follow these steps precisely.
Step 1 — Scope
If $ARGUMENTS is provided, scope your work to those files or directories. Otherwise, discover the project root and instrument the main application code.
Step 2 — Detect Language & Frameworks
Scan the codebase to determine:
- Language: Python (look for
*.py,pyproject.toml,requirements.txt) or TypeScript (look for*.ts,*.tsx,package.json) - LLM frameworks in use — search imports for these patterns:
| Import pattern | Framework | Integration |
|---|---|---|
from openai / import OpenAI |
OpenAI | track_openai |
import anthropic |
Anthropic | track_anthropic |
More from comet-ml/opik-skills
opik
Opik observability for LLM agents — Agent Configuration, Local Runner (opik connect), Test Suites, threads, integrations. Use for "configure my agent", "connect my agent", "evaluate my agent" or "integrate with Opik".
173agent-config
Opik Agent Configuration — Blueprints, get_agent_config() with selectors, environment tags, Prompt/ChatPrompt fields, deploy_to(), MaskIDs, and config lifecycle.
5agent-ops
Agent lifecycle — architecture, configuration (Blueprints), Local Runner, evaluation, threads, production monitoring. Use for "evaluate my agent", "connect my agent", "configure my agent", "add guardrails".
5opik-connect
Opik Connect (Local Runner) — pair your local agent with the Opik browser UI for Python and TypeScript.
5instrument-typescript
Adding Opik observability to TypeScript/JS LLM apps — track() with entrypoint and explicit params for Local Runner, framework integrations.
5evaluation-suites
Opik Evaluation Suites — assertions, execution policies, CI integration. Replaces old Datasets API.
5