6. Verify ingestion
Confirm a trace actually arrived — don't assume. Prefer the SDK for verification: it's already installed as part of instrumenting (zero extra moving parts), whereas the Opik MCP is optional and may not be connected.
The SDK read of one trace and its spans: references/verify-ingestion.md (SDK check).
To find the newest trace instead of using a known id, use the client's trace search (e.g. search_traces) scoped to the project. Optionally, if the Opik MCP is connected, list recent traces then read the newest.
Traces are asynchronous — allow a few seconds after the run and make sure the flush ran.
Verify coverage, not just arrival. A trace arriving is necessary but not sufficient — batching can silently drop or truncate spans, so a trace can land incomplete and still look fine. Before reporting verified:
- Count vs. expected. Compare
len(spans) (the search_spans call in references/verify-ingestion.md, project_name included) against the call sites you instrumented on the path you ran (entrypoint + each traced tool/LLM). Fewer spans than expected means spans were dropped — do not report verified.
- Every span is well-formed. Each span has a non-empty
name and type; LLM spans carry input/output (and usage where the integration provides it). A span returned with an empty name/type is the batching-race symptom in references/verify-ingestion.md, not a real span.
With the Opik MCP connected, verify there instead. read(entity_type="trace", id=tid) returns {trace, spans, spansTruncated} with the span tree inlined (up to 200 spans), so both checks above run over that one call, no script needed: count the spans against the instrumented call sites, and confirm each has a name/type and the LLM spans carry input/output. If spansTruncated is true, count with the SDK instead. The SDK stays the default because it is already installed; the MCP is the shortcut when it is there.
If the trace is empty, partial, or has unnamed spans, check references/verify-ingestion.md (Common ingestion traps) before changing the instrumentation.
7. Report
Return a short human result + the trace link (see Output), then make the single expansion offer.
Blockers
When you genuinely can't proceed, stop at the earliest blocker and return exactly one next step — never a checklist — and still report the changes already made (blocked carries changes). An unsupported language or shape is unsupported and modifies nothing. Examples:
- "Run
opik configure, then rerun /opik-instrument."
- "Install dependencies with
uv sync, then rerun /opik-instrument."
- "Which dev command safely exercises this agent?"
- "Instrumented and installed, but the run needs a provider credential — set
OPENAI_API_KEY (or the relevant provider key) and rerun."
- "Instrumented and ran, but this environment can't query Opik — open the project and confirm trace
<id> arrived."
Expansion — after the trace lands (one offer, not a funnel)
Do not migrate prompts, add threading, or broaden spans during activation. After verification, make a single consolidated offer of what you found, e.g.:
Tracing is verified. I also found ways to deepen it: 3 Prompt Library candidates, missing conversation threading, and 2 untraced tools. Expand?
Output
User-facing: a short human message — what was instrumented, the trace link, and the one expansion offer (or, if blocked, the single next step plus what changed). Not raw JSON.
Underneath (for composition / evals), a small state model, with its invariants: references/output-shape.md.
Examples
Worked runs (no LLM framework, OpenAI, already instrumented): references/examples.md.
Anti-patterns
Double-wrapping (integration + manual span on the same call); orphaned LiteLLM traces (missing current_span_data); missing flush in scripts; overwriting or duplicating config; running an unsafe/production path just to force a trace; broad dependency upgrades when only opik is needed; migrating prompts during activation.
References
SDK detail lives in the opik skill, installed beside this one. Read the files directly — paths are relative to this file: ../opik/references/tracing-python.md, ../opik/references/tracing-typescript.md, ../opik/references/integrations.md, ../opik/references/observability.md. If your host lays skills out differently, locate the opik skill's references/ directory.
If the opik skill isn't installed, say so in the report and use https://www.comet.com/docs/opik/ rather than working from memory.