On 12 November, OpenTelemetry published an account of agents writing instrumentation for GenAI frameworks. The authors use a team of agents to inspect a framework, propose hooks, write instrumentation and test the emitted telemetry. Engineers review the plan and the resulting pull request.
The detail I keep coming back to is what their first validation loop missed. A reviewing model sometimes approved telemetry that violated the conventions. The authors replaced that judgement with Weaver, which compares emitted data with a semantic-convention registry and returns a failing result for violations. That is a useful check. A clean report still leaves a question for the team deploying the instrumentation: did the trace describe the work that actually ran?
This is design analysis with illustrative TypeScript, not a measured result. I haven’t run the authors’ harness or the code below. The invoice workflow is invented for the analysis, and its checks are proposals rather than features I have verified in Weaver.
What the harness checks
The authors’ account separates research, planning, implementation, testing and observation. The research stage looks for public extension points first. An engineer reviews the execution plan, including the proposed hook locations and where attribute values will come from. Only then does the coding agent implement it.
Their observation stage runs an instrumented workload and passes its OpenTelemetry Protocol output through weaver registry live-check. The authors give one concrete finding: generated instrumentation had set a successful tool span’s status to OK, which their policy flagged as a violation. They describe a separate coverage matrix, too, but say that in those runs coverage is measured rather than used as a build gate. A clean violation report and a high coverage number are different signals.
The distinction is useful because a validator sees what the scenario emits. If the scenario never calls a tool, the absence of a tool span might be expected. If it calls the tool twice and the instrumentation records only one call, valid names and types on that one span cannot establish that both calls were captured. Whether a particular missing span is caught depends on the scenario and its assertions, not on the word “conformance” alone.
The public conformance repository runs small programs, collects telemetry through Weaver and checks expectations declared in YAML. Its GenAI tooling supplies a registry pin, advice policies and a mock model server. I like that the scenario is an explicit part of the evidence: it gives a reviewer something concrete to run and change. It also means I need to read the scenario before treating its result as a statement about my workload.
The running example
Imagine an invoice assistant that extracts fields with a model, calls find_invoice, and asks a separate service to submit an approved credit. A user request crosses the application, a model client, a tool server and a finance backend. On a timeout, the harness may retry a read. The credit service accepts or rejects the write according to its own policy.
A useful trace should show the model call, each tool attempt and the outcome of the request to the finance service. I would also want the trace relationships to reflect which operation caused which work. A tool span with the right name and an UNSET success status is useful, but it is incomplete evidence if a second attempt is invisible or the span was attached to an unrelated request.
That last distinction matters during an incident. An operator trying to explain a delayed credit may see one clean tool span and conclude that the tool was called once. The service’s own record may show two attempts, one timed out and one rejected. If the trace omits the first attempt, the dashboard is not lying about that recorded span. It is giving the operator an incomplete account of the workflow.
I would compare instrumentation against a separate source of record in tests. For the read tool, that can be a controlled fake that records invocations. For the credit, use the fake finance service’s decision and idempotency records. The test harness should own those records separately from the tracing code; deriving the expected count from the trace itself would only compare the trace with itself.
Four kinds of evidence
| Question | Example check | What a pass doesn’t establish |
|---|---|---|
| Are emitted fields valid? | Weaver checks names and types against a pinned registry | The scenario exercised every path |
| Did the instrumented operation run? | Compare tool spans with fake tool invocations | Production export is complete |
| Is the meaning right? | Check parent, timing, outcome and attribute sources | Every future framework version uses the same hooks |
| Did telemetry arrive? | Send a synthetic run through the collection path | Every real trace was retained |
These are proposed checks for a platform team, not four modes of a particular product. Each has its own failure condition. I would keep their reports separate so that a schema fix doesn’t look like a fix for a missing tool call.
For the invoice assistant, write a scenario where find_invoice times out once and succeeds on retry. The fake service records two attempts. Under a test configuration that records and exports all spans, assert two tool spans, their order where the scenario guarantees it, and their association with the correct agent run. Then make the fake reject the credit and check that the trace describes a rejected operation rather than a completed credit. If asynchronous work continues after the initiating request ends, decide whether a parent relationship or a link describes the actual relationship and test that choice.
The following is illustrative test logic, not a Weaver API. The test adapter projects ended spans from a controlled run into the same simple outcome vocabulary as the fake service; those fields are not a claim about OpenTelemetry attribute names. A real implementation needs to set up the SDK, await exporter flush and identify spans using its chosen convention version.
type Attempt = { tool: string; outcome: "success" | "error" };
type ObservedSpan = { tool: string; outcome: "success" | "error" };
function compareAttempts(
calls: Attempt[],
spans: ObservedSpan[],
): void {
const expected = calls.map(({ tool, outcome }) => `${tool}:${outcome}`);
const observed = spans.map(({ tool, outcome }) => `${tool}:${outcome}`);
if (JSON.stringify(expected) !== JSON.stringify(observed)) {
throw new Error("Tool attempts and recorded spans differ");
}
}
I would only compare ordered arrays when the test makes the operations sequential. Concurrent calls need stable test identifiers and an order-independent comparison. Neither a span name nor a trace ID should be used as an authorisation decision or as the financial system’s idempotency key. The finance record stays authoritative for whether the credit was issued.
Review the hook, not just the output
The OpenTelemetry authors say that their research agent favours public hooks and callbacks when those expose the necessary lifecycle. Their CrewAI example used method wrapping for compatibility with older versions whose callbacks did not expose the full start and end lifecycle; they say newer versions provide a broader event-listener API that should be evaluated first. The point is not that wrapping is always wrong. It is that the choice needs a version range, an owner and a reason.
For each candidate hook, I would ask where a span starts and ends, what happens on exceptions and cancellation, and whether a streaming response ends the span when the request is sent or when the stream is consumed. A hook that sees only the initial call cannot report a later failure it never observes. If the framework queues work for another process, I would inspect the context passed with the message and test what happens after a worker restart.
The authors describe another boundary in their discussion of the Claude Agent SDK: its Python package wraps a closed-source CLI, so their plugin can observe the process boundary but not the loop and dispatch inside it. I would record that as a known visibility limit. A clean conformance run cannot recover an internal event the integration cannot observe.
The mapping from framework objects to attributes also deserves review. If token counts come from provider usage data, the instrumentation should take them from that response rather than estimating them from text without labelling the estimate. If usage is missing, test the missing case instead of quietly substituting zero. Zero is a measurement; absence can mean the information wasn’t supplied.
I would pin the framework, instrumentation package and registry used in the test, then run the scenarios against each supported version. On upgrade, review changed hooks and a representative trace before updating the pin. The Tracing API defines spans as operations with timing and relationships. It cannot decide for my application which callback actually marks the completion of an invoice lookup.
The collection path has its own failure modes
A passing integration test tells me what happened in that test environment. Production adds sampling, exporters, queues, collectors and a backend query. Any of those can make a trace incomplete without changing the instrumented code.
The Collector scaling guide describes one subtle case: if spans from a trace reach different collectors doing tail sampling, they can make different decisions and produce incomplete traces. The guide recommends routing consistently by trace ID before that stateful processing. I would test the actual topology during scaling and rollout, including what happens while collector membership changes. Consistent routing is a design requirement to verify, not a promise that every deployment already meets it.
For the invoice workflow, keep operational counts independently of sampled traces. OpenTelemetry’s article on missing telemetry suggests reconciling accepted work with completed, rejected and still-processing work over a window that permits normal delay. For an agent, define the unit first: one user request, one tool attempt or one credit instruction. Those counts must not be mixed. Account for retries and deduplication explicitly, and include a sufficiently old backlog rather than labelling every in-flight request a loss.
A synthetic invoice run can check the path end to end without moving money: use a test tenant, a non-mutating finance fake and no personal data. Check that the expected spans arrive within an agreed window. A successful synthetic proves that this particular path carried a known event at that time. It doesn’t prove that all customer traces arrived or that a different tool is instrumented.
Content policy remains separate from completeness. OpenTelemetry’s GenAI observability walkthrough describes content capture as opt-in in its example because prompts and tool arguments can contain sensitive data. In my earlier monitoring post, I looked at who can read agent content. Here I would start with metadata and synthetic inputs, then make a separate decision about whether any real content is necessary for a test or investigation.
What I’d do on Monday
- Pick one workflow and write down the model, tool and backend operations that should appear.
- Review the instrumentation plan against public hooks, supported versions and lifecycle boundaries.
- Pin the semantic-convention registry and run conformance against deterministic success and failure scenarios; fail if a scenario emits nothing.
- Compare recorded tool attempts with an independent fake, including retries, rejection and cancellation.
- Check parentage, timing and missing usage data rather than treating valid attribute names as proof of meaning.
- Send a safe synthetic run through the deployed collection path and monitor exporter failures and queue pressure.
- Reconcile workflow counts independently of sampled traces, with explicit treatment of in-flight work.
Limitations
This is design analysis with unrun illustrative code. I haven’t measured the authors’ generated instrumentation, run Weaver or tested a Collector topology. The scenarios and controls above would need implementation and review against the specific SDK and semantic-convention version in use.
The OpenTelemetry post is the authors’ account of their own tooling, not an independent evaluation of agent-generated code. Its conformance findings are evidence about the scenarios they describe, not a claim that a passing check proves complete observability for every framework or production workload.