-
Notifications
You must be signed in to change notification settings - Fork 651
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
Support OTEL_SPAN_ATTRIBUTE_SIZE_LIMIT #1847
Conversation
48264f2
to
1c1cbab
Compare
Please assign yourself to #1845 if you are working on this. |
00f90fd
to
92b72fe
Compare
95a78b0
to
19b675b
Compare
CHANGELOG.md
Outdated
@@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
([#1829](https://github.com/open-telemetry/opentelemetry-python/pull/1829)) | |||
- Lazily read/configure limits and allow limits to be unset. | |||
([#1839](https://github.com/open-telemetry/opentelemetry-python/pull/1839)) | |||
- Added support for read/configure limits and allow limits to be unset. |
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.
Is this description accurate?
Could you add a link to where this is defined in the specs? |
_clean_attributes( | ||
resource_attributes, self._limits.max_attribute_size | ||
) | ||
self._resource = Resource(resource_attributes) |
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.
Can we apply _clean_attributes
in the Resource
constructor instead of here?
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.
Limits and Resource instances both are provided to TracerProvider as arguments. If we want to do this inside Resource, we need to be able to pass Limits to Resource constructor and expect users to do it. Another thing we can do is add a method on Resource and call it from here so it'd look like:
self._resource = self._resource._with_limits(self._limits)
This will allow us to call _clean_attributes
from within Resource class but not sure how much better that would be as the end result would be pretty much the same i.e, new instance of resource will be created given it is immutable.
Yet another thing we can do is to not apply these limits to resource attributes for now. In practice these limits are useful for spans where an instrumentation might generate very large fields like storing very long stack traces as attributes. Such issues don't plague resources so I'm completely fine with not applying these limits to resource attributes.
19b675b
to
0ed5768
Compare
0ed5768
to
5be7a88
Compare
Closing in favor of #2044 |
Description
Adds support for OTEL_SPAN_ATTRIBUTE_SIZE_LIMIT to allow limiting/truncating string values in attributes.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: