opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

feat: add support for OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT

Open msierks-pcln opened this issue 4 months ago • 4 comments

User description

Fixes https://github.com/open-telemetry/opentelemetry-rust/discussions/2214

Changes

Add support for the OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT environment variable as explained in Opentelemetry SDK environment variable doc. This will truncate Value::String and Array::String attribute values if they exceed the limit.

  • Adds TracerProviderBuilder::with_max_attribute_value_length()

Merge requirement checklist

  • [x] CONTRIBUTING guidelines followed
  • [x] Unit tests added/updated (if applicable)
  • [x] Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • [ ] Changes in public API reviewed (if applicable)

msierks-pcln avatar Jul 28 '25 17:07 msierks-pcln

CLA Not Signed

Codecov Report

:x: Patch coverage is 96.07843% with 6 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 80.2%. Comparing base (42139cb) to head (f7dc9cd).

Files with missing lines Patch % Lines
opentelemetry-sdk/src/trace/span.rs 93.4% 3 Missing :warning:
opentelemetry-sdk/src/trace/config.rs 66.6% 2 Missing :warning:
opentelemetry/src/common.rs 98.8% 1 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3090     +/-   ##
=======================================
+ Coverage   80.1%   80.2%   +0.1%     
=======================================
  Files        126     126             
  Lines      21957   22109    +152     
=======================================
+ Hits       17603   17752    +149     
- Misses      4354    4357      +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jul 28 '25 18:07 codecov[bot]

@msierks-pcln Can you sign the CLA, so we can consider contributions? It's a one-time process and is mandatory. If contributing on behalf of your employer, please do consult them before signing.

cijothomas avatar Aug 01 '25 18:08 cijothomas

@msierks-pcln Can you sign the CLA, so we can consider contributions? It's a one-time process and is mandatory. If contributing on behalf of your employer, please do consult them before signing.

@cijothomas Yes, I'm working on this with my employer.

msierks-pcln avatar Aug 05 '25 12:08 msierks-pcln