Skip to content

Remove deprecated methods from util-genai - #823

Merged
lmolkova merged 9 commits into
open-telemetry:mainfrom
rads-1996:remove-deprecated-methods
Oct 3, 2026
Merged

lmolkova merged 9 commits into
open-telemetry:mainfrom
rads-1996:remove-deprecated-methods

Conversation

@rads-1996

Copy link
Copy Markdown
Contributor

Description

Fixes #246

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. List any relevant details for your test
configuration.

  • Test suites have been run to ensure existing functionality does not break.

Checklist

See CONTRIBUTING.md
for the style guide, changelog guidance, and more.

  • Followed the style guidelines of this project
  • Changelog updated if the change requires an entry
  • Unit tests added
  • Documentation updated

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-03 00:36 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@rads-1996
rads-1996 force-pushed the remove-deprecated-methods branch 2 times, most recently from f414af5 to 60ec0d4 Compare October 1, 2026 20:34
@rads-1996
rads-1996 marked this pull request as ready for review October 1, 2026 21:40
@rads-1996
rads-1996 requested a review from a team as a code owner October 1, 2026 21:40
Copilot AI balanced review requested due to automatic review settings October 1, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Deprecated API remnants, stale compatibility code, and a prohibited Pyright suppression remain unresolved.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Removes deprecated util-genAI lifecycle APIs and updates affected tests and reviewer guidance.

Changes:

  • Removes deprecated TelemetryHandler factories, lifecycle helpers, and utility functions.
  • Migrates Anthropic and util tests to current factories.
  • Updates changelog and repository instructions.
File Description
.github/​instructions/​instrumentation.instructions.md Updates handler construction guidance.
.github/​instructions/​util-genai.instructions.md Updates invocation factory guidance.
util/​opentelemetry-util-genai/​.changelog/​823.removed Records removed APIs.
util/​opentelemetry-util-genai/​src/​opentelemetry/​util/​genai/​handler.py Removes deprecated handler APIs.
util/​opentelemetry-util-genai/​src/​opentelemetry/​util/​genai/​utils.py Removes deprecated content helpers.
util/​opentelemetry-util-genai/​src/​opentelemetry/​util/​genai/​_inference_invocation.py Adjusts the content-mode import.
util/​opentelemetry-util-genai/​tests/​test_utils.py Removes legacy API tests.
util/​opentelemetry-util-genai/​tests/​test_toolcall.py Uses the current tool factory.
util/​opentelemetry-util-genai/​tests/​test_handler_workflow.py Renames workflow tests.
util/​opentelemetry-util-genai/​tests/​test_handler_metrics.py Renames inference metric tests.
instrumentation/​opentelemetry-instrumentation-genai-anthropic/​tests/​test_async_wrappers.py Migrates to handler.inference().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread util/opentelemetry-util-genai/.changelog/823.removed Outdated
Comment thread util/opentelemetry-util-genai/src/opentelemetry/util/genai/utils.py Outdated
@rads-1996
rads-1996 marked this pull request as draft October 1, 2026 21:46
@rads-1996
rads-1996 force-pushed the remove-deprecated-methods branch from babd674 to b0a52b2 Compare October 1, 2026 23:46
@rads-1996
rads-1996 requested a balanced review from Copilot October 1, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Deprecated APIs are removed consistently, remaining repository references are updated, and behavioral coverage is retained.

Review effort: Balanced
Findings: None

Resolved since last review (3)

@rads-1996
rads-1996 force-pushed the remove-deprecated-methods branch from b0a52b2 to 457d9a6 Compare October 2, 2026 14:41
@rads-1996
rads-1996 marked this pull request as ready for review October 2, 2026 15:47

@lmolkova lmolkova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! A small comment and we should be good to go

)


def get_telemetry_handler(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing get_telemetry_handler breaks released packages on import. langchain 1.0b0, 1.1b0, 1.1b1 and openai-agents 1.0b0, 1.1b0 import it at module level and accept any util below 2, so pip will pair them with the next util release.

Could we keep it, still deprecated, for the rest of 1.x? No released package from this repo uses the other removed APIs.

#841 adds a CI check that catches this kind of break.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. I have addressed the feedback.

@rads-1996
rads-1996 force-pushed the remove-deprecated-methods branch from 16427ae to 0e0eb21 Compare October 3, 2026 00:10
@lmolkova
lmolkova added this pull request to the merge queue Oct 3, 2026
Merged via the queue into open-telemetry:main with commit 93c3dfe Oct 3, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deprecated methods in gen-ai utils

3 participants