-
Notifications
You must be signed in to change notification settings - Fork 557
feat: add support for OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT #3090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,14 @@ impl SdkTracer { | |
.saturating_sub(span_attributes_limit); | ||
attribute_options.truncate(span_attributes_limit); | ||
let dropped_attributes_count = dropped_attributes_count as u32; | ||
let span_attribute_value_limit = span_limits.max_attribute_value_length; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can tell, this method is used by the |
||
if span_attribute_value_limit > -1 { | ||
for attribute in attribute_options.iter_mut() { | ||
attribute | ||
.value | ||
.truncate(span_attribute_value_limit as usize); | ||
} | ||
} | ||
|
||
// Links are available as Option<Vec<Link>> in the builder | ||
// If it is None, then there are no links to process. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you enhance the doc to make it clear that this is applicable to string values or array of strings.
and also mention that the trimming behavior is simply trimming!
(some people might expect "..." being added as the last 3 characters to indicate trimming has occurred.. But we are not doing that, and there is no way a backend can tell if trimming has occurred. So if a user opts in to this, they should be made aware of the implications)