Skip to content

Deprecate GenericPart and stop emitting it from instrumentations - #936

Merged
lmolkova merged 3 commits into
open-telemetry:mainfrom
lmolkova:deprecate-generic-part
Oct 21, 2026
Merged

lmolkova merged 3 commits into
open-telemetry:mainfrom
lmolkova:deprecate-generic-part

Conversation

@lmolkova

Copy link
Copy Markdown
Member

Deprecates GenericPart in opentelemetry-util-genai and removes its usage from the Anthropic, Bedrock and Google GenAI instrumentations.

Semconv defines GenericPart so the JSON schema can accept future and custom part types. Instrumentations used it as a type-only placeholder that carries no content. Content should map to a specific part type or be dropped. AGENTS.md, the review instructions and the skills are updated to match.

Known gaps:

  • GenericPart stays in the MessagePart and SystemInstructionPart unions for backward compatibility.
  • Some content is now dropped and could be mapped to specific types in follow-ups: Bedrock video/audio/guardContent blocks, Google GenAI non-text system instruction parts.

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.

🟢 Approval recommended

The targeted removals match the documented scope, preserve public compatibility, and update regression expectations without identified blocking issues.

No open issues 🎉

What changed in this PR

Deprecates GenericPart in the shared GenAI utility and stops emitting type-only placeholders from Anthropic, Bedrock, and Google GenAI instrumentations.

Changes:

  • Retains GenericPart in public unions for backward compatibility.
  • Drops previously placeholder-only content and updates regression assertions.
  • Aligns changelogs and contributor guidance with the deprecation.
File Description
util/​opentelemetry-util-genai/​src/​opentelemetry/​util/​genai/​types.py Documents deprecation; preserves unions.
util/​opentelemetry-util-genai/​.changelog/​936.deprecated Announces deprecation.
instrumentation/​opentelemetry-instrumentation-google-genai/​tests/​interactions/​test_parser.py Expects unsupported inputs to be dropped.
instrumentation/​opentelemetry-instrumentation-google-genai/​tests/​generate_content/​test_message.py Expects text-only system instructions.
instrumentation/​opentelemetry-instrumentation-google-genai/​src/​opentelemetry/​instrumentation/​google_genai/​message.py Removes system-instruction placeholders.
instrumentation/​opentelemetry-instrumentation-google-genai/​src/​opentelemetry/​instrumentation/​google_genai/​interactions.py Removes unsupported-input placeholders.
instrumentation/​opentelemetry-instrumentation-google-genai/​.changelog/​936.changed Records capture changes.
instrumentation/​opentelemetry-instrumentation-genai-bedrock/​tests/​test_converse.py Updates dropped-content expectations.
instrumentation/​opentelemetry-instrumentation-genai-bedrock/​src/​opentelemetry/​instrumentation/​genai/​bedrock/​extractors.py Removes unmapped-content placeholders.
instrumentation/​opentelemetry-instrumentation-genai-bedrock/​.changelog/​936.changed Records capture changes.
instrumentation/​opentelemetry-instrumentation-genai-anthropic/​tests/​test_messages_extractors.py Checks dropping without consuming content.
instrumentation/​opentelemetry-instrumentation-genai-anthropic/​tests/​test_iterator_transparency.py Updates file-backed capture expectations.
instrumentation/​opentelemetry-instrumentation-genai-anthropic/​src/​opentelemetry/​instrumentation/​genai/​anthropic/​utils.py Drops placeholders without reading sources.
instrumentation/​opentelemetry-instrumentation-genai-anthropic/​.changelog/​936.changed Records capture changes.
AGENTS.md Adds guidance against deprecated usage.
.github/​skills/​write-conformance-tests/​SKILL.md Removes generic-part mapping guidance.
.github/​skills/​migrate-from-openinference/​SKILL.md Updates migration mapping guidance.
.github/​instructions/​instrumentation.instructions.md Adds deprecated-usage review guidance.

Review effort: Balanced

@opentelemetry-pr-dashboard

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

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-21 05:00 UTC

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

# Conflicts:
#	instrumentation/opentelemetry-instrumentation-google-genai/tests/generate_content/test_message.py
@lmolkova
lmolkova added this pull request to the merge queue Oct 21, 2026
Merged via the queue into open-telemetry:main with commit cda8106 Oct 21, 2026
83 checks passed
@lmolkova
lmolkova deleted the deprecate-generic-part branch October 21, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants