apm-agent-python
apm-agent-python copied to clipboard
Limit the length for all fields
All fields should be limited to KEYWORD_MAX_LENGTH, with the exception of the fields noted in the long fields spec, which should be limited to a length of 10000. Optionally, we can make the latter limit configurable, as stated in the spec.
I think this is enforced for most things at this point.
- SQL queries are shortened in the
dbapi2code. - Local vars are shortened in the client code
Obviously any keyword fields are already shortened.
@beniwohli I think with the age of this issue I'm going to close it as resolved. If we do run into any more issues I suppose we could write a processor that would shorten everything -- but that's probably not a precise-enough instrument, since different things need to be shortened differently. Keep me posted if you think there's still work to do here.
Just kidding. Found some more conversation in the cross-agent meta issue, I guess this is still in flux despite the issue-open date. Pardon my noise.
https://github.com/elastic/apm/blob/main/specs/agents/field-limits.md#long_field_max_length-configuration was spec'd a while ago. That covers a specific set of fields. (The Node.js APM agent truncates other fields at 1024.)
LONG_FIELD_MAX_LENGTH introduced in #1610 and added to Django's capture_body. First of many places.
Length of exception message field limited in https://github.com/elastic/apm-agent-python/pull/1619
Length of Starlette bodies limited in https://github.com/elastic/apm-agent-python/pull/1549