Feature/3303 otlp exporter limits #3816
Open
+107
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, andAddLink. Drops are tracked in the protodropped_counts.Options: Added 5 limit fields to
OtlpHttpExporterOptionsandOtlpGrpcExporterOptions(default:UINT32_MAX/ no limit).Exporters: Updated
MakeRecordablein both HTTP and gRPC exporters to pass the configured limits to the recordable.Tests: Added unit tests in
otlp_recordable_test.ccto verify drops occur when limits are exceeded.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changesI 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