Skip to content

feat: log record attribute value length limit#4132

Open
proost wants to merge 4 commits into
open-telemetry:mainfrom
proost:feat-logrecord-attr-value-length-limit
Open

feat: log record attribute value length limit#4132
proost wants to merge 4 commits into
open-telemetry:mainfrom
proost:feat-logrecord-attr-value-length-limit

Conversation

@proost
Copy link
Copy Markdown
Contributor

@proost proost commented Jun 6, 2026

Fix: #4126

Changes

Adding new feature OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT following spec.

I referred below:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#logrecord-limits
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#logrecord-limits
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#logrecord-limits

Following spec, I changed SDK only.

I plan to apply decorator way. Before setter called, I tried to enforce this feature to log record. Problem is this is inevitable to current SDK. If have any suggestions, please give me some feedback.

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@proost proost requested a review from a team as a code owner June 6, 2026 08:40
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 91.17647% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.96%. Comparing base (e649c7f) to head (241b298).

Files with missing lines Patch % Lines
sdk/include/opentelemetry/sdk/logs/recordable.h 86.67% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4132      +/-   ##
==========================================
+ Coverage   81.94%   81.96%   +0.03%     
==========================================
  Files         385      387       +2     
  Lines       16067    16123      +56     
==========================================
+ Hits        13164    13214      +50     
- Misses       2903     2909       +6     
Files with missing lines Coverage Δ
...emetry/exporters/elasticsearch/es_log_recordable.h 0.00% <ø> (ø)
exporters/elasticsearch/src/es_log_recordable.cc 65.39% <100.00%> (ø)
...opentelemetry/exporters/otlp/otlp_log_recordable.h 100.00% <ø> (ø)
exporters/otlp/src/otlp_log_recordable.cc 36.06% <100.00%> (ø)
sdk/include/opentelemetry/sdk/logs/logger_config.h 100.00% <100.00%> (ø)
sdk/src/logs/log_record_limits.cc 100.00% <100.00%> (ø)
sdk/src/logs/logger.cc 89.54% <100.00%> (+0.13%) ⬆️
sdk/src/logs/logger_config.cc 100.00% <100.00%> (ø)
sdk/src/logs/multi_recordable.cc 90.55% <100.00%> (ø)
sdk/src/logs/read_write_log_record.cc 96.35% <100.00%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Implement LogRecord limits

1 participant