Skip to content

Tracking: migrate OpenInference Python instrumentations into this repo #141

@lmolkova

Description

@lmolkova

This issue tracks porting the OpenInference Python instrumentation packages into
opentelemetry-python-genai, so that GenAI instrumentation is built on the shared
opentelemetry-util-genai utilities and emits telemetry that conforms to the
GenAI semantic conventions.

Important

Candidate packages (ordered by recent PyPI downloads):

OI package Downloads last month Assignee Status and link(s) to PR Notes
openinference-instrumentation-langchain 2,303,629 @wrisa @keith-decker @lzchen Existing package: opentelemetry-instrumentation-genai-langchain
openinference-instrumentation-openai 1,988,421 @eternalcuriouslearner Existing package: opentelemetry-instrumentation-genai-openai
openinference-instrumentation-pydantic-ai 777,820 Native instrumentation — won't port. See Pydantic AI OpenTelemetry/Logfire docs
openinference-instrumentation-anthropic 715,867 @eternalcuriouslearner Existing package: opentelemetry-instrumentation-genai-anthropic
openinference-instrumentation-claude-agent-sdk 625,120 Existing package: opentelemetry-instrumentation-genai-claude-agent-sdk
openinference-instrumentation-openai-agents 576,006 @eternalcuriouslearner Blocked on #90 Existing package: opentelemetry-instrumentation-genai-openai-agents
openinference-instrumentation-google-adk 572,630 Native instrumentation — won't port. See ADK Cloud Trace / OpenTelemetry docs
openinference-instrumentation-agno 505,207
openinference-instrumentation-litellm 504,172
openinference-instrumentation-google-genai 472,235 @DylanRussell Existing package: opentelemetry-instrumentation-google-genai
openinference-instrumentation-crewai 415,635
openinference-instrumentation-llama-index 413,031
openinference-instrumentation-haystack 393,875
openinference-instrumentation-bedrock 350,897
openinference-instrumentation-instructor 130,202
openinference-instrumentation-mistralai 120,700
openinference-instrumentation-dspy 119,851
openinference-instrumentation-groq 117,114
openinference-instrumentation-vertexai 114,965 Won't add — the library is deprecated
openinference-instrumentation-smolagents 114,073
openinference-instrumentation-mcp 83,845 Native instrumentation — won't port. See modelcontextprotocol/python-sdk#2381
openinference-instrumentation-portkey 33,488
openinference-instrumentation-autogen 13,098
openinference-instrumentation-beeai 12,368
openinference-instrumentation-strands-agents 10,318
openinference-instrumentation-agent-framework 7,385
openinference-instrumentation-autogen-agentchat 3,831
openinference-instrumentation-guardrails 3,390
openinference-instrumentation-pipecat 1,419
openinference-instrumentation-agentspec 690

Migration guidance

  • Build on opentelemetry-util-genai. Avoid emitting spans, metrics, or events directly — use the
    shared utilities so all packages produce consistent, conformant telemetry, share the same configuration
    options and extensibility hooks, and to reduce maintenance toil.
  • Do use AI to help with the port and the review. Minimize use of AI when talking to humans.
  • Use the provided migration and review skills (to be added in Add skills to help with instrumentation migration #143) to drive the port consistently.
  • Contribute back to the migration skills so the workflow improves as we go.
  • If migration needs a design decision or some discussion, create individual issues for these
  • Keep the PR scoped to the migration only. Do not instrument new operations and do not
    add new features beyond what the source instrumentation already does. Adding missing tests
    for the migrated behavior is encouraged.

Naming

  • Package names follow the opentelemetry-instrumentation-genai-{lib} pattern, where {lib} is
    the PyPI name of the instrumented library — e.g. crewai
    opentelemetry-instrumentation-genai-crewai, importing as
    opentelemetry.instrumentation.genai.crewai. This MAY be different from the suffix used by OpenInference.

Version support

  • Consider supporting only the latest major version of the instrumented library and dropping
    compatibility with older versions, to reduce maintenance toil.

Existing packages

  • For libraries that already have a package in this repo (marked "Existing package" above), do
    not re-port from scratch. Instead, analyze the delta between the OpenInference
    instrumentation and the existing code — operations covered, scenarios, attributes, captured
    content — and contribute only what's missing or improved back into the existing package.
    Do not modify existing code. If refactoring is helpful, do it as a follow-up to the migration PR.

Semantic conventions

  • When there is no convention for a specific operation or scenario, file a bug in
    open-telemetry/semantic-conventions-genai
    to get it specified.
  • In the meantime, report an empty span where appropriate (e.g. an operation span without
    speculative attributes). Do not report unconventional / non-spec attributes.
    Leave TODOs in the code pointing to the semconv issue.

Tests

  • Add conformance tests for the important scenarios of each library:
    • LLM clients: inference + tool calling + reasoning + multi-modal content, embeddings.
    • Agents: invoke_agent + tools, workflows, orchestration.
  • Add missing unit test coverage for the instrumentation logic (if anything is missing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    New issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions