Unpin opentelemetry-api in opentelemetry-sdk

オープン
#5,920 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, testing

調査の方向性

Start with the dependency declarations in opentelemetry-sdk/pyproject.toml and opentelemetry-semantic-conventions/pyproject.toml, then inspect the SDK API method implementations and the CI configuration. The issue also points to #5877 for the typing pattern and related issues #5886 and #5877 for context. Done means relaxing both API version bounds, accepting unknown keyword arguments in SDK implementations, and adding CI coverage for an older SDK with the main API.

索引モデルが issue の本文から書いたものです。

説明

feature-request
Is your feature request related to a problem?

opentelemetry-sdk currently pins an exact opentelemetry-api version (opentelemetry-api == 1.X.Y):
https://github.com/open-telemetry/opentelemetry-python/blob/47ee451a1df869362106a36640a7ab0e2245a1a2/opentelemetry-sdk/pyproject.toml#L29

When instrumentation or third-party packages require a newer opentelemetry-api, users are forced to upgrade opentelemetry-sdk in lockstep or hit dependency conflicts. #5886 unblocks relaxing this pin by making API ABCs tolerate unknown future kwargs in older SDK subclasses.

Describe the solution you'd like
  1. Change opentelemetry-api from == to >= (with < 2.0) in both opentelemetry-sdk/pyproject.toml and opentelemetry-semantic-conventions/pyproject.toml. Both need to change because opentelemetry-sdk pins opentelemetry-semantic-conventions, which also pins an exact opentelemetry-api version:

    "opentelemetry-api >= 1.46.0.dev, < 2.0",
    

    On each release, the release scripts will continue bumping the lower bound to match the SDK release (e.g. >= 1.46.0, < 2.0, then >= 1.47.0, < 2.0), so older SDKs work with newer 1.x APIs while new SDKs still require at least their matching API version.

  2. Add **_kwargs: Unpack[Empty] (see #5877) to opentelemetry-sdk's API method implementations so the SDK natively ignores unknown future kwargs without SignatureCompatABC wrapper overhead while keeping static type-checking strict.

  3. Add a CI test running an older released opentelemetry-sdk against main's opentelemetry-api.

Describe alternatives you've considered

Instead of bumping the >= lower bound on every release, we could keep a fixed minimum opentelemetry-api version across releases (only bumping it when the SDK actually uses new API symbols, as originally proposed in #1924) so newer SDKs also work with older APIs (#4993). That would be nice eventually, but requires testing opentelemetry-sdk against older PyPI opentelemetry-api versions in CI (tox.ini has {oldest,latest}, though monorepo deps currently install editable from the repo).

Additional Context

Related: #1924, #4993, #5392, #5877, #5886

Would you like to implement a fix?

Yes

Tip

No response

主要言語
Python
スター
2.7k
フォーク
1.1k
平均マージ
3日 12時間
マージ済み PR(30日)
16

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

open-telemetry/opentelemetry-python のほかの issue

open-telemetry/opentelemetry-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。