[FIX] Not tracking when multibyte payload#15
[FIX] Not tracking when multibyte payload#15aran112000 wants to merge 1 commit intopatrickkerrigan:masterfrom
Conversation
AWS fails to capture trace when payload contains a multibyte char as the length results in a truncated, malformed payload
|
Thanks for the PR! Please would you be able to post a minimal example script that reproduces this issue along with the truncated/malformed payload you're seeing? I've so far been unable to reproduce this using unicode strings. For example, the following script produces a valid payload: <?php
use Pkerrigan\Xray\Segment;
use Pkerrigan\Xray\Submission\DaemonSegmentSubmitter;
use Pkerrigan\Xray\Trace;
require 'vendor/autoload.php';
Trace::getInstance()
->setSampled(true)
->setName('app.example.com')
->setUrl('/')
->setMethod('POST')
->begin();
Trace::getInstance()
->getCurrentSegment()
->addSubsegment(
(new Segment())
->setName('☃')
->begin()
->end()
);
Trace::getInstance()
->end()
->setResponseCode(200)
->submit(new DaemonSegmentSubmitter());Note that PHP's However, after applying the change in this PR I get a truncated payload (which I'd expect as My immediate suspicion is that it may actually be that AWS doesn't expect characters to be escaped, but given you mentioned the payload is getting truncated I'm keen to get to the bottom of that before testing with x-ray itself. Thanks! |
AWS fails to capture trace when payload contains a multibyte char as the length results in a truncated, malformed payload