Napp/xray-laravel

AWS Client return error MissingEndTime

jaycom opened this issue · 6 comments

Get the error from AWS client.
Do you have any idea about my error message?

AWS Client return error
"UnprocessedTraceSegments": [ { "Id": "c2a0319811ccbc58", "ErrorCode": "MissingEndTime", "Message": "Invalid subsegment. ErrorCode: MissingEndTime, Cause: null" } ], "@metadata": { "statusCode": 200, "effectiveUri": "https:\/\/xray.ap-east-1.amazonaws.com\/TraceSegments", "headers": { "date": "Sat, 15 May 2021 10:56:22 GMT", "content-type": "application\/json", "content-length": "156", "connection": "keep-alive", "x-amzn-requestid": "022d118f-b269-448c-b895-ae8e195d8962" }, "transferStats": { "http": [ [] ] } }

Submit data
{ "id": "c2a0319811ccbc58", "trace_id": "1-609fa8d4-1fad76e1dd7f69f43beb0695", "name": "***", "start_time": 1621076180.124956, "end_time": 1621076181.859172, "subsegments": [...] } ], "annotations": { "Framework": "Laravel 5.8.38", "PHP Version": "7.4.2" }, "http": { "request": { "url": "***", "method": "GET", "client_ip": "::1" }, "response": { "status": 200 } } }

I'm getting this and InvalidName errors. How did you get the Submit data? Can you please include the subsegments field? I'm using DaemonSegmentSubmitter

@patricknazar you can see the submit data if you start the daemon locally and set the log level to debug
Also it appears to be the general framework segment which is missing an end_time property. if you set XRAY_FRAMEWORK to false it works for me locally, will see how it behaves on lambda.

EDIT

This might not be entirely true, it seems like i can only trigger a trace if I interact with the app through a unit test can't trigger one locally through valet.

Only thing i found out is the only segment i'm missing is a end_time property is the composer autoload one.

EDIT 2

this could be caused by these lines never getting called:

$this->app->booting(function () {
    $this->addSegment('laravel boot');
    $this->endSegment('composer autoload');
});

$this->app->booted(function () {
    $this->endSegment('laravel boot');
});

EDIT 3

I had some success locally now if i comment out the code mentioned above which seems to simply never get called. But none hosted so far.

Getting the same error, and currently testing out @marvinosswald 's branch: https://github.com/Napp/xray-laravel/compare/master...marvinosswald:no-composer-starttime?expand=1
Doesn't seem to be the best solution - but without it doesn't work with:

laravel/framework: v8.49.0

@viezel can see you are top contributor - is there any interest from you to resolve this?

@kimegede sure, will you please prepare a PR with the fix?

Would love to help, but currently no idea how to resolve it.
If the problem relates to Laravel not triggering those registered event listeners - which seems to be Laravel built-in events.
It seems I will have a hard time resolving it on my own.

Do you have any inputs or ideas?