Skip to content

[OPIK-8185] opik-instrument: verify span coverage + guard common ingestion traps - #173

Open
aswynz wants to merge 1 commit into
mainfrom
aswynz/OPIK-8185/instrument-verify-coverage-traps
Open

[OPIK-8185] opik-instrument: verify span coverage + guard common ingestion traps#173
aswynz wants to merge 1 commit into
mainfrom
aswynz/OPIK-8185/instrument-verify-coverage-traps

Conversation

@aswynz

@aswynz aswynz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What

Enhances the opik-instrument skill's Step 6 — Verify ingestion so that "verified" means a complete trace, not just that a trace arrived.

  • Coverage check — compare the number of spans from search_spans against the call sites instrumented on the exercised path; every span must have a non-empty name/type, and LLM spans must carry input/output. Fewer or empty spans ⇒ not verified.
  • Common ingestion traps guard — a short checklist for the failure modes that make a trace land empty / partial / unnamed: the batching race on fast spans, post-hoc feedback/score binding, and missing flush.

Why

The skill already runs a safe path and checks that a trace arrives. But a trace can arrive silently incomplete — batching can drop or unname fast spans, and post-hoc scores can be lost if posted before the span's create reaches the backend. These were hit first-hand while instrumenting a multi-agent app from scratch: a tracer adapter that passed all unit tests and a static audit still lost trace data across three runs; only running the app and inspecting the platform caught it. A "code edits alone are not success" skill should catch that class of failure.

Docs-only change to the authored skill (src/opik_mcp/skills/opik-instrument/SKILL.md); the public opik-skills pack is built verbatim from it.

Closes OPIK-8185.

🤖 Generated with Claude Code

…stion traps

The verify step confirmed a trace arrived but not that it was complete, and
did not warn about the silent ingestion traps that make a trace land partial.
Add a coverage check (expected spans vs search_spans; well-formed name/type)
and a short "common ingestion traps" guard (batching race, post-hoc feedback,
missing flush), so "verified" means a complete trace, not just any trace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

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`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aswynz let's add a tip that if opik mcp is available - the agent can use it for verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants