Skip to content

Conversation

@Joshua-Elsner
Copy link

Fixes #3303

This PR implements collection limits (max attributes, max events, max links, etc.) directly in the OTLP Exporter options. This allows users to enforce limits at the exporter level, which is useful when the exporter is used in a "firehose" mode or independently of the SDK limits.

Changes

  • OtlpRecordable: Added logic to check limits in SetAttribute, AddEvent, and AddLink. Drops are tracked in the proto dropped_counts.

  • Options: Added 5 limit fields to OtlpHttpExporterOptions and OtlpGrpcExporterOptions (default: UINT32_MAX / no limit).

  • Exporters: Updated MakeRecordable in both HTTP and gRPC exporters to pass the configured limits to the recordable.

  • Tests: Added unit tests in otlp_recordable_test.cc to verify drops occur when limits are exceeded.
    For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
    I did not update CHANGELOG.md to avoid merge conflicts, but I am happy to add an entry if requested.

  • Unit tests have been added

  • Changes in public API reviewed

Signed-off-by: Joshua <joshuaelsner97@gmail.com>
Signed-off-by: Joshua <joshuaelsner97@gmail.com>
Signed-off-by: Joshua <joshuaelsner97@gmail.com>
Signed-off-by: Joshua <joshuaelsner97@gmail.com>
@Joshua-Elsner Joshua-Elsner requested a review from a team as a code owner January 19, 2026 04:31
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 19, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.96%. Comparing base (25c923a) to head (84572ac).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3816      +/-   ##
==========================================
+ Coverage   89.94%   89.96%   +0.02%     
==========================================
  Files         225      225              
  Lines        7167     7167              
==========================================
+ Hits         6446     6447       +1     
+ Misses        721      720       -1     

see 1 file with indirect coverage changes

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

Signed-off-by: Joshua <joshuaelsner97@gmail.com>
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.

SDK Implement collection limits

1 participant