Skip to content

fix(sdk): apply global attribute limit fallbacks - #2058

Merged
bobstrecansky merged 1 commit into
open-telemetry:mainfrom
tayfuryldz:fix/2055-global-attribute-limits
Sep 23, 2026
Merged

bobstrecansky merged 1 commit into
open-telemetry:mainfrom
tayfuryldz:fix/2055-global-attribute-limits

Conversation

@tayfuryldz

Copy link
Copy Markdown
Contributor

Fixes #2055.

What changed

  • apply OTEL_ATTRIBUTE_COUNT_LIMIT as the fallback for span, span-event, span-link, and log-record attribute counts
  • apply OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT as the fallback for span/event/link and log-record attribute value lengths
  • preserve model-specific precedence: OTEL_SPAN_*, OTEL_EVENT_*, OTEL_LINK_*, and OTEL_LOGRECORD_* win when explicitly configured
  • keep metrics untouched, since metric attributes are exempt from the common attribute limits
  • add regression tests for both fallback and precedence

The fallback order follows the common attribute-limit specification: model-specific configuration first, then the general limit, then the model-specific default.

Validation

  • regression tests: 9 tests, 16 assertions
  • Trace/Logs unit suite + SpanLimits integration coverage: 406 tests, 868 assertions
    • local run excludes the existing SDK/Trace/ExporterFactoryTest.php because this rootless PHP runtime does not have native ext-grpc; the only failures in the unfiltered run were the two existing gRPC exporter cases (Grpc\\ChannelCredentials unavailable)
  • PHPStan on all changed source/test files: 0 errors
  • PHP CS Fixer on all changed files
  • git diff --check

@tayfuryldz
tayfuryldz requested a review from a team as a code owner September 16, 2026 13:37
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

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

  • ✅ login: TayfurYldz / name: TayfurYldz (2233314)

@tayfuryldz
tayfuryldz force-pushed the fix/2055-global-attribute-limits branch from 0140bf9 to 2233314 Compare September 16, 2026 13:40

@tayfuryldz tayfuryldz left a comment

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.

/easycla

Copy link
Copy Markdown
Contributor Author

/easycla

@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.16%. Comparing base (979a2d8) to head (2233314).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/SDK/Logs/LogRecordLimitsBuilder.php 87.50% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2058      +/-   ##
============================================
+ Coverage     68.07%   68.16%   +0.08%     
- Complexity     3084     3090       +6     
============================================
  Files           459      459              
  Lines          9035     9047      +12     
============================================
+ Hits           6151     6167      +16     
+ Misses         2884     2880       -4     
Flag Coverage Δ
8.1 67.86% <94.44%> (+0.13%) ⬆️
8.2 68.65% <94.44%> (+0.66%) ⬆️
8.3 68.00% <94.44%> (+0.07%) ⬆️
8.4 67.98% <94.44%> (-0.01%) ⬇️
8.5 68.00% <94.44%> (+0.09%) ⬆️
8.6 68.00% <94.44%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/SDK/Trace/SpanLimitsBuilder.php 66.66% <100.00%> (+5.12%) ⬆️
src/SDK/Logs/LogRecordLimitsBuilder.php 90.47% <87.50%> (+10.47%) ⬆️

... and 5 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 979a2d8...2233314. Read the comment docs.

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

@bobstrecansky
bobstrecansky merged commit 91dd7fd into open-telemetry:main Sep 23, 2026
15 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.

OTEL_ATTRIBUTE_COUNT_LIMIT / OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT are ignored

4 participants