Napp / xray-laravel

AWS X-Ray tracing for Laravel apps
MIT License
56 stars 34 forks source link

Tracing doesn't work with Elastic Beanstalk #14

Open csimpi opened 3 years ago

csimpi commented 3 years ago

Hi, thank you for this package! I would like to use AWS X-Ray on an Elastic Beanstalk environment. I've enabled X-Ray the daemon is listening on 127.0.0.1:2000 AWSXRayDaemonWriteAccess has been attached to the aws-elasticbeanstalk-ec2-role role. The package has been installed and implemented to my Laravel App. I've changed the submitter in the /config/xray.php to \Napp\Xray\Submission\DaemonSegmentSubmitter::class

Everything looks fine, but for some reason, nothing appears on the X-Ray console. Did I miss something?

aln-1 commented 2 years ago

Hi, thank you for this package! I would like to use AWS X-Ray on an Elastic Beanstalk environment. I've enabled X-Ray the daemon is listening on 127.0.0.1:2000 AWSXRayDaemonWriteAccess has been attached to the aws-elasticbeanstalk-ec2-role role. The package has been installed and implemented to my Laravel App. I've changed the submitter in the /config/xray.php to \Napp\Xray\Submission\DaemonSegmentSubmitter::class

Everything looks fine, but for some reason, nothing appears on the X-Ray console. Did I miss something?

The problem is that the ALB does not pass the 'Sampled=1' chunk of the trace id header HTTP_X_AMZN_TRACE_ID. take a look at https://github.com/Napp/xray-laravel/issues/3

I ended extending the XrayServiceProvider boot method and modifying the header by adding ;Sampled=1 at the and of it. After that x-ray started logging.

adrianpaiva1 commented 1 year ago

@aln-1 Is it possible for you to share an example of exactly what you did?

aln-1 commented 1 year ago

@aln-1 Is it possible for you to share an example of exactly what you did?

I don't have this chunk of code anymore but my previous reply explains the solution clearly.

KostLinux commented 9 months ago

Hello! It's 2023 here, does anyone have solution for this issue? @aln-1