---
type: "post"
id: "building-an-agent-harness-for-otel-instrumentation-with-20f477"
slug: "building-an-agent-harness-for-otel-instrumentation-with-20f477"
title: "Building an Agent Harness for OTel Instrumentation with GenAI Semantic Conventions and Weaver"
description: "Alibaba engineers describe an agent harness that generates OpenTelemetry instrumentation for GenAI frameworks, then checks its output against semantic conventions and runtime behavior."
retrieval_nugget: "Alibaba engineers describe an agent harness that generates OpenTelemetry instrumentation for GenAI frameworks, then checks its output against semantic conventions and runtime behavior. The useful lesson for builders is the separation of agent implementation from reviewable planning and machine-enforced validation: a model’s confidence is not a conformance test."
published_at: "2026-11-20"
updated_at: "2026-11-20"
record_date: "2026-11-20"
date_kind: "published_at"
topics: ["agent-harness","claude"]
entities: ["OpenTelemetry","Alibaba Cloud","OpenTelemetry Weaver","LoongSuite Python","CrewAI","LangChain","Claude Agent SDK"]
related_patterns: ["harness-architecture-outlives-model-choice"]
novelty_label: "new_fact"
what_changed: "OpenTelemetry describes an agent harness for GenAI instrumentation using semantic conventions and Weaver."
prior_refs: ["https://newruntime.com/posts/trace-agents-with-opentelemetry-on-the-claude-platform-a01c87/"]
source_url: "https://opentelemetry.io/blog/2026/agent-harness-genai-instrumentation"
source_urls: ["https://opentelemetry.io/blog/2026/agent-harness-genai-instrumentation"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:building-an-agent-harness-for-otel-instrumentation-with-20f477"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/building-an-agent-harness-for-otel-instrumentation-with-20f477/","markdown":"https://newruntime.com/posts/building-an-agent-harness-for-otel-instrumentation-with-20f477.md","json":"https://newruntime.com/posts/building-an-agent-harness-for-otel-instrumentation-with-20f477.json"}
markdown_url: "https://newruntime.com/posts/building-an-agent-harness-for-otel-instrumentation-with-20f477.md"
---

# Building an Agent Harness for OTel Instrumentation with GenAI Semantic Conventions and Weaver

## Retrieval answer

Alibaba engineers describe an agent harness that generates OpenTelemetry instrumentation for GenAI frameworks, then checks its output against semantic conventions and runtime behavior. The useful lesson for builders is the separation of agent implementation from reviewable planning and machine-enforced validation: a model’s confidence is not a conformance test.

## Summary
Alibaba engineers describe an agent harness that generates OpenTelemetry instrumentation for GenAI frameworks, then checks its output against semantic conventions and runtime behavior. The useful lesson for builders is the separation of agent implementation from reviewable planning and machine-enforced validation: a model’s confidence is not a conformance test.

## What happened
OpenTelemetry’s announcement, written by Huxing Zhang and Ziming Liu of Alibaba Cloud and dated November 12, 2026, describes a system for creating instrumentation plugins for GenAI frameworks. The work involves inspecting a framework, choosing extension points, mapping operations to OpenTelemetry’s GenAI semantic conventions, testing the result, and maintaining it as the framework changes. The authors say this can take experienced contributors days and can produce inconsistent span boundaries, attributes, and units across frameworks.

The system combines the semantic conventions, OpenTelemetry Weaver, and an orchestrator. The conventions define span names, attribute names and units, including fields for models, tokens, messages, and tool calls. Weaver’s live-check starts an OTLP listener, processes telemetry through advisors, and compares it with the resolved convention registry. Its built-in checks include missing attributes and type mismatches; policies add naming and formatting checks. Findings are classified as violations, improvements, or information. By default, a violation makes Weaver exit non-zero. The orchestrator checks out a repository, runs the agents, and opens a pull request; the authors use a self-hosted multi-agent task platform.

The agent team has distinct roles. A lead schedules work and owns loop state. A research agent studies the target framework and looks first for public hooks or callbacks. A planning agent scores candidate strategies for complexity, maintainability, and coverage, then writes an `execution-plan.md` specifying integration points and attribute sources. An engineer can review that plan before implementation. Coding, code review and unit tests follow; an agent also prepares end-to-end tests in parallel. The system runs examples with instrumentation in a Kubernetes test cluster, sends emitted OTLP data through Weaver, and proceeds to a soak test for memory leaks and runtime regressions if validation passes. Engineers can interrupt the lead to change the plan or repeat a step.

The authors give examples of framework-specific choices. For the OpenAI Agents SDK, lifecycle hooks are preferred. Their CrewAI plugin supports versions back to 0.80, where public callbacks did not expose the complete lifecycle needed for the spans, so the plan selected method wrapping. Newer CrewAI versions have a broader event-listener API that should be evaluated first. In another example, Weaver flagged a tool span whose status was set to OK; the non-zero result sent the finding back for correction. Coverage measurement is separate: a matrix tracks 29 registry-defined attributes across 14 LoongSuite Python instrumentations, while missing coverage can be recorded with `--report-only` rather than blocking a run.

The generated plugins are in LoongSuite Python, Alibaba’s Apache-2.0 OpenTelemetry Python instrumentation distribution, and were reviewed by a human at pull-request stage. The authors list coverage including CrewAI, LangChain, LangGraph, LiteLLM, AutoGen, AgentScope, Dify, Google ADK, Claude Agent SDK, Microsoft Agent Framework, MCP, and mem0, as well as agent benchmarks. They say work is underway to bring instrumentation to the OpenTelemetry Python GenAI project, where initial pull requests are under review.

## What the archive adds
New Runtime’s earlier coverage on [tracing agents with OpenTelemetry on the Claude Platform](https://newruntime.com/posts/trace-agents-with-opentelemetry-on-the-claude-platform-a01c87/) described native trace export as a way to inspect agent execution in existing observability systems. This is a new event on the same broader observability thread: Alibaba details how agents can help create instrumentation, and how that instrumentation is checked before it is merged.

## Trend signal
This supports [harness architecture outlives model choice](https://newruntime.com/patterns/harness-architecture-outlives-model-choice/). The account makes the durable workflow boundary the orchestration, reviewable plan, semantic conventions, validation runner, and human approvals—not a particular model. Its agents can perform different stages of the work, while the harness controls what must be checked before a pull request is accepted.

## Why now
OpenTelemetry’s account says instrumentation work is repeated as new GenAI frameworks appear and existing frameworks change. The authors describe using the harness across a range of frameworks and agent SDKs, while working to upstream plugins into the OpenTelemetry Python GenAI project. That makes repeatable conformance checks relevant as integrations spread across different APIs.

## Connections to other events
New Runtime’s earlier coverage on [tracing agents with OpenTelemetry on the Claude Platform](https://newruntime.com/posts/trace-agents-with-opentelemetry-on-the-claude-platform-a01c87/) focused on making agent runs visible in established observability tools. Alibaba’s account moves one step upstream: it uses agent workflows to build that instrumentation, then tests emitted telemetry against shared conventions. Together, the work points to observability as both an operational need and a development interface for agent systems.

## Why it matters
For teams using coding agents to build integrations, this case offers a useful architecture: let agents investigate and implement, but make the intended integration strategy inspectable before code is written. A plan that names extension points and attribute sources gives reviewers a concrete artifact to challenge. Unit and end-to-end tests catch implementation failures, while a registry-based check can detect semantic mismatches that a model reviewer may approve incorrectly.

The distinction between a blocking violation and a coverage measurement is especially useful. A hard gate can stop a known-invalid span from shipping; a coverage matrix can show missing attributes without treating every gap as a build failure. Runtime soak testing adds a further check for problems such as memory leaks. This does not remove framework expertise: the authors say planning still needs knowledgeable human review, particularly when lifecycle details are not obvious from the API.

## What happens next
- **The OpenTelemetry Python GenAI project will merge at least one instrumentation pull request from this effort** (6 months, 65%). Watch for: a merged pull request in the project repository.
- **The authors will continue migrating LoongSuite plugins toward upstream OpenTelemetry utilities** (6 months, 60%). Watch for: published upstream instrumentation packages or migration notes.

## Limits and uncertainty
The announcement is an account from the engineers building the system, not an independent evaluation. The listed plugin coverage does not establish equal conformance, maintenance quality, or production adoption across every framework. The authors describe a concrete visibility limit: because the Claude Agent SDK wraps a closed-source CLI, instrumentation can capture activity crossing the process boundary but not internal agent-loop details. They also say framework expertise remains necessary to assess lifecycle choices, and the upstreaming effort is still in progress with pull requests under review.

## Skill to build now
For one integration your team maintains, write a short plan before asking an agent to implement it: identify public hooks, list the lifecycle events and attribute sources, and name cases that should be tested. Turn the most consequential convention violations into a failing check, while reporting coverage gaps separately if they are not release blockers. This creates a reviewable target and gives the agent a concrete feedback loop instead of asking a second model to judge whether its output looks right.

## Reader takeaway
Use agents to accelerate framework investigation and implementation, but do not make the agent the authority on whether its telemetry is correct. A reviewed plan, executable conformance checks, tests, and runtime observation form a more dependable harness than model judgment alone.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Agent Harness](https://newruntime.com/topics/agent-harness.md): Explore the agent-harness topic hub.
- topic hub: [Claude](https://newruntime.com/topics/claude.md): Explore the claude topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
