Skip to content

Tracking: migrate OpenInference Python instrumentations into this repo #141

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 @rads-1996 #181 (closed, not merged)
#188 - merged
#261 - merged
#272 - merged
#281 - merged
#302 - merged
#305 - merged
#334 - merged
#296 - open
openinference-instrumentation-openai 1,988,421 @eternalcuriouslearner #184 - merged
#269 - merged
#278 - merged
#282 - merged
#355 - merged
#358 - open
openinference-instrumentation-pydantic-ai 777,820 Won't port Has native instrumentation
openinference-instrumentation-anthropic 715,867 @eternalcuriouslearner #191 - merged
#269 - merged
#302 - merged
openinference-instrumentation-claude-agent-sdk 625,120 #297 (closed, not merged)
openinference-instrumentation-openai-agents 576,006 @eternalcuriouslearner #302 - merged
#100 - stale
openinference-instrumentation-google-adk 572,630 Won't port Has native instrumentation
openinference-instrumentation-agno 505,207 @DylanRussell #301 - merged (skeleton)
#328 - merged
#350 - open
openinference-instrumentation-litellm 504,172 @alexander-akhmetov @jgordley Has native instrumentation, check the policy before starting
openinference-instrumentation-google-genai 472,235 @DylanRussell #165 - merged
#176 - merged
#232 - merged
#233 - merged
#271 - merged
#283 - merged
#304 - merged
#326 - stale
openinference-instrumentation-crewai 415,635 @venkata-pavani #224 (closed, not merged)
#308 - merged (skeleton)
#363 - open
#384 - draft
Native instrumentation, not compatible, context
openinference-instrumentation-llama-index 413,031 @eternalcuriouslearner #309 - merged (skeleton)
openinference-instrumentation-haystack 393,875 @srinjoy356 #318 - open
#373 - open
Overlapping PRs, one should be closed.
Has native instrumentation, check the policy before starting
openinference-instrumentation-bedrock 350,897 @DylanRussell #359 - open (skeleton) Overlaps with opentelemetry-instrumentation-botocore in contrib, which already instruments Bedrock Runtime.
Needs a plan to avoid double instrumentation, see discussion
openinference-instrumentation-instructor 130,202
openinference-instrumentation-mistralai 120,700 Won't port Has native instrumentation
openinference-instrumentation-dspy 119,851
openinference-instrumentation-groq 117,114 @royrhea #368 (closed, not merged)
#313 - open
openinference-instrumentation-vertexai 114,965 Won't add The library is deprecated
openinference-instrumentation-smolagents 114,073 @alexander-akhmetov #349 - merged (skeleton)
#352 - open
#340 - draft
openinference-instrumentation-mcp 83,845 Won't port Has native instrumentation
openinference-instrumentation-portkey 33,488
openinference-instrumentation-autogen 13,098 Has native instrumentation, check the policy before starting
openinference-instrumentation-beeai 12,368 Has native instrumentation, check the policy before starting
openinference-instrumentation-strands-agents 10,318 @Shriprasad-P Has native instrumentation, check the policy before starting
openinference-instrumentation-agent-framework 7,385 Has native instrumentation, check the policy before starting
openinference-instrumentation-autogen-agentchat 3,831 Has native instrumentation, check the policy before starting
openinference-instrumentation-guardrails 3,390
openinference-instrumentation-pipecat 1,419 Has native instrumentation, check the policy before starting
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

    Projects

    Status
    New issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions