open-telemetry / open-telemetry/opentelemetry-python-contrib

Update bootstrap_gen to detect GenAI libraries with instrumentations

Open
#4,816 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request gen-ai
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

What problem do you want to solve?

New/Migrated OTel Python GenAI instrumentation libraries were just released 🎉

It would be nice if opentelemetry-bootstrap --action=install could install them too if corresponding frameworks are installed in current environment, while using the distro. This idea has come up a couple times in the Python SIG meetings but I don't think a ticket was created.

Describe the solution you'd like

Update bootstrap_gen to detect GenAI libraries with instrumentations, and install instrumentations accordingly. What's been migrated so far are:

  1. opentelemetry-util-genai==1.0b0
  2. opentelemetry-instrumentation-google-genai==1.0b1
  3. opentelemetry-instrumentation-genai-openai-agents==1.0b0
  4. opentelemetry-instrumentation-genai-openai==1.0b0
  5. opentelemetry-instrumentation-genai-langchain==1.0b0
  6. opentelemetry-instrumentation-genai-anthropic==1.0b0

Current bootstrap does install these but they should be removed as they follow the "old" Python naming and are published from old home contrib repo:

pip install opentelemetry-instrumentation-google-genai
pip install opentelemetry-instrumentation-langchain
Describe alternatives you've considered

It is currently up to users to install individual instrumentation libraries, from OTel and from OpenLLMetry.

Additional Context

No response

Would you like to implement a fix?

No response

Tip

No response

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 with opentelemetry/instrumentation/bootstrap_gen.py and trace the --action=install flow, including how it detects installed frameworks and selects the distro. Compare the current Google GenAI and LangChain handling with the six migrated GenAI libraries listed in the issue. Done means bootstrap installs the corresponding migrated instrumentations and no longer installs the old-naming packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.