elastic / elastic/apm-agent-nodejs

HTTP body truncation truncates at wrong length

Open
#940 1 comment 0 reactions 0 assignees View on GitHub
agent-nodejs bug
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

According to [the documentation](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#capture-body), HTTP bodies should be truncated at a fixed 2k bytes. With the new algorithm that truncates all strings at 1024 bytes, this unfortunately overwrites that. So not only are we truncating twice, the second time we're truncating at the wrong size.

I think the best solution is moving the body truncation logic to the HTTP client instead of having it in the agent like it is today.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.