open-telemetry / open-telemetry/opentelemetry-python-genai

[Instrumentation] Contribute loongsuite GenAI instrumentations to OTel Python GenAI

Open
#185 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39
Forks
63
Avg merge
1d 15h
Merged PRs (30d)
175

Description

Summary

We would like to contribute a set of GenAI instrumentation packages from alibaba/loongsuite-python to this repository. These instrumentations follow the OpenTelemetry GenAI Semantic Conventions and have been validated through the genai-otel-conformance test suite.

Motivation

There is a growing ecosystem of GenAI agent frameworks and LLM libraries that lack official OTel instrumentation. We have developed and tested instrumentations for 26 additional libraries, covering:

  • Inference Spans (chat completions, text generation)
  • Agent Spans (create agent, invoke agent client/internal)
  • Embeddings Spans
  • Execute Tool Spans
  • Client Operation Duration Metric (gen_ai.client.operation.duration)
  • Client Token Usage Metric (gen_ai.client.token.usage)

Conformance Test Results

All proposed instrumentations have passed the GenAI OTel Conformance Tests. The full conformance dashboard showing coverage across Required, Conditionally Required, Recommended, and Opt-In attributes for each signal type is attached below:

dashboard-full.pdf

Proposed Instrumentations

Below is the full list of instrumentations available for contribution, grouped by priority:

Priority 1: Popular Open-Source Frameworks (High Community Value)
Instrumentation Target Package Description
loongsuite-instrumentation-crewai crewai >= 0.80.0 Multi-agent orchestration framework
loongsuite-instrumentation-langgraph langgraph >= 0.2 LangChain agent orchestration
loongsuite-instrumentation-litellm litellm >= 1.0.0 Universal LLM proxy/gateway
loongsuite-instrumentation-google-adk google-adk >= 0.1.0 Google Agent Development Kit
loongsuite-instrumentation-dashscope dashscope >= 1.0.0 Alibaba Cloud model serving platform
loongsuite-instrumentation-qwen-agent qwen-agent >= 0.0.20 Qwen agent framework
loongsuite-instrumentation-mcp mcp >= 1.3.0 Model Context Protocol
loongsuite-instrumentation-mem0 mem0ai >= 1.0.0, < 2.0.0 Memory layer for AI apps
loongsuite-instrumentation-dify dify LLMOps platform
loongsuite-instrumentation-agno agno >= 2.0.0, < 3 Agent framework
loongsuite-instrumentation-agentscope agentscope >= 1.0.0 Multi-agent platform
Priority 2: Agent Evaluation & Benchmark Frameworks
Instrumentation Target Package Description
loongsuite-instrumentation-openhands openhands AI software engineering agent
loongsuite-instrumentation-minisweagent mini-swe-agent >= 2.2.0 Minimal SWE agent
loongsuite-instrumentation-bfclv4 bfcl-eval >= 4.0.0 Function calling evaluation
loongsuite-instrumentation-claw-eval claw-eval >= 0.1.0 Agent evaluation framework
loongsuite-instrumentation-algotune algotune Algorithm tuning benchmark
loongsuite-instrumentation-webarena webarena >= 0.0.1 Web agent benchmark
loongsuite-instrumentation-widesearch widesearch >= 0.1.0 Search agent benchmark
loongsuite-instrumentation-wildtool openai >= 1.0.0 Tool-use evaluation
Priority 3: Domain-Specific Agent Instrumentations
Instrumentation Target Package Description
loongsuite-instrumentation-claude-agent-sdk claude-agent-sdk >= 0.1.0 Anthropic Claude agent SDK
loongsuite-instrumentation-hermes-agent openai >= 1.0.0 Hermes agent framework
loongsuite-instrumentation-qwenpaw qwenpaw >= 1.1.0 QwenPaw personal assistant
loongsuite-instrumentation-slop-code slop-code-bench >= 0.1 Code agent benchmark
loongsuite-instrumentation-terminus2 terminal-bench >= 0.1.0 Terminal agent benchmark
loongsuite-instrumentation-vita vita >= 0.0.1 Vita agent
loongsuite-instrumentation-langchain langchain_core >= 0.1.0 Enhanced LangChain instrumentation

Semantic Convention Coverage

Each instrumentation emits telemetry aligned with the GenAI semantic conventions. Example coverage for Inference Spans:

  • Required: gen_ai.operation.name, gen_ai.system
  • Conditionally Required: error.type, gen_ai.request.model, server.address, server.port
  • Recommended: gen_ai.response.finish_reasons, gen_ai.response.id, gen_ai.response.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens
  • Opt-In: gen_ai.input.messages, gen_ai.output.messages, gen_ai.system_instructions, gen_ai.tool.definitions

Contribution Plan

We propose to contribute these instrumentations in phases:

  1. Phase 1: Submit Priority 1 instrumentations (popular open-source frameworks) as individual PRs
  2. Phase 2: Submit Priority 2 instrumentations (evaluation/benchmark frameworks)
  3. Phase 3: Submit Priority 3 instrumentations (domain-specific agents)

Each PR will include:

  • Instrumentation source code (following existing package structure)
  • Unit tests
  • Updated conformance test data in genai-otel-conformance

Source Repository

Questions for Maintainers

  1. Is there a preference for batching PRs (e.g., one PR per instrumentation, or grouping related ones)?
  2. For libraries that already have instrumentations in this repo (e.g., langchain, claude-agent-sdk), should we propose enhancements to existing packages or submit as alternatives?
  3. Are there any specific requirements for evaluation/benchmark-focused instrumentations vs. production-library instrumentations?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing package structure in this repository and comparing it with the instrumentation code in alibaba/loongsuite-python. Read the genai-otel-conformance results and contribution plan, then clarify with maintainers whether to submit individual packages or enhancements to existing instrumentations; completion depends on that scope decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.