Skip to content

fix(sdk): require sem-conv ^1.38 for VERSION_1_38_0 constant#2003

Merged
bobstrecansky merged 1 commit into
open-telemetry:mainfrom
PuvaanRaaj:fix/1922-semconv-constraint
Jul 9, 2026
Merged

fix(sdk): require sem-conv ^1.38 for VERSION_1_38_0 constant#2003
bobstrecansky merged 1 commit into
open-telemetry:mainfrom
PuvaanRaaj:fix/1922-semconv-constraint

Conversation

@PuvaanRaaj

Copy link
Copy Markdown
Contributor

Problem

Closes #1922.

SDK resource detectors (Environment, Host, Sdk, Process, Service, ServiceInstance, Composer) reference OpenTelemetry\SemConv\Version::VERSION_1_38_0, which was introduced in open-telemetry/sem-conv 1.38.0. However src/SDK/composer.json only required ^1.36.0.

Resolving sem-conv to 1.36 or 1.37 (easy to hit via composer update --minimal-changes) produces a fatal error at runtime:

Undefined constant OpenTelemetry\SemConv\Version::VERSION_1_38_0
  in vendor/open-telemetry/sdk/Resource/Detectors/Environment.php:26

Fix

Bump the open-telemetry/sem-conv constraint in the SDK package from ^1.36.0 to ^1.38.0 so the referenced constant is guaranteed to exist.

Contrib does not reference any Version::VERSION_1_3x constant, so its constraint is left unchanged.

🤖 Generated with Claude Code

@PuvaanRaaj
PuvaanRaaj requested a review from a team as a code owner July 8, 2026 04:12
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 8, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: PuvaanRaaj / name: PuvaanRaaj (2a10c5d)

@PuvaanRaaj

Copy link
Copy Markdown
Contributor Author

@open-telemetry/php-approvers this is a small, self-contained dependency-constraint fix for #1922 — would appreciate a review when you have a moment. 🙏

SDK resource detectors reference `Version::VERSION_1_38_0`, added in
open-telemetry/sem-conv 1.38.0, but composer.json allowed `^1.36.0`.
Resolving sem-conv to 1.36 or 1.37 (e.g. via `composer update -m`) triggers
a fatal "Undefined constant ...VERSION_1_38_0" at runtime in the detectors.

Bump the constraint so the constant is guaranteed to exist.

Fixes open-telemetry#1922

- Rollback: revert commit; restores `^1.36.0` constraint.

Risk-Level: low
AI-Agent: claude-opus-4-8
@PuvaanRaaj
PuvaanRaaj force-pushed the fix/1922-semconv-constraint branch from 9d350d2 to 2a10c5d Compare July 8, 2026 07:24
@PuvaanRaaj

Copy link
Copy Markdown
Contributor Author

/easycla

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.00%. Comparing base (697aefd) to head (2a10c5d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #2003   +/-   ##
=========================================
  Coverage     68.00%   68.00%           
  Complexity     3078     3078           
=========================================
  Files           459      459           
  Lines          9023     9023           
=========================================
  Hits           6136     6136           
  Misses         2887     2887           
Flag Coverage Δ
8.1 67.74% <ø> (-0.02%) ⬇️
8.2 67.95% <ø> (+0.05%) ⬆️
8.3 67.98% <ø> (+0.07%) ⬆️
8.4 67.91% <ø> (+0.01%) ⬆️
8.5 67.91% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 697aefd...2a10c5d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisLightfootWild
ChrisLightfootWild requested a review from a team July 8, 2026 08:21
@bobstrecansky
bobstrecansky merged commit c11238a into open-telemetry:main Jul 9, 2026
12 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.

Wrong composer version dependency

3 participants