Closed ankon closed 1 year ago
Looking into this...
FWIW: As we're not using the go-agent's secure agent functionality, and this really appears massively in our profiles, we decided to fork the agent and comment out the offending line.
See https://github.com/framer/go-agent/commit/9bc8fe953abae3e51223f52ae7db5862b5d9a5de.
Note that while our fork is public, we will not make any guarantees that anyone else could use it for any purpose etc -- if you find the problem appear as well, the best approach is probably to create your own fork :)
We're preparing to push our fix for this to the official repo shortly as well, FYI.
Fixed in Release 3.24.1.
https://github.com/newrelic/go-agent/blob/046b4fc116adac2b4dec4d691b61a25b80488fc2/v3/newrelic/internal_response_writer.go#L33
If we're reading our profiles correctly, then this line is actually very expensive in a busy HTTP(S) server: Every []byte that gets written out now needs to be converted to a string, and passed along to the security agent. That might be a no-op on its own, but we still seem to pay the cost for figuring that out.
(We're obviously also looking into the other parts here, but getting rid of that
slicebytetostring
would be nice indeed.