patrickkerrigan / php-xray

A PHP instrumentation library for AWS X-Ray
BSD 3-Clause "New" or "Revised" License
63 stars 26 forks source link

Argument #1 ($host) must be of type string, null given #17

Closed saugat86 closed 1 year ago

saugat86 commented 1 year ago
Pkerrigan\Xray\Submission\DaemonSegmentSubmitter::__construct(): Argument #1 ($host) must be of type string, null given, called in /vendor/napp/xray-laravel/src/Submission/DaemonSegmentSubmitter.php on line 44

I gave the hostname and port of the X-Ray daemon from two environment variables, _AWS_XRAY_DAEMON_ADDRESS and _AWS_XRAY_DAEMON_PORT respectively before passing them to this library as well. I gave the env variables as

....
XRAY_ENABLED=true
_AWS_XRAY_DAEMON_ADDRESS="127.0.0.1"
_AWS_XRAY_DAEMON_PORT=2000
....
patrickkerrigan commented 1 year ago

Hi Saugat,

From the error message it looks like it's being triggered from a file belonging to Napp/xray-laravel.

The advice I've provided in the past based on my limited knowledge of that package is to set the environment variables that you mention you're already setting. Given that's not helped in this case, I'm afraid I can only point you towards Napp/xray-laravel who should be better placed to assist on this one.

I can see you've also raised the issue over there, so I'll go ahead and close this one off. Hopefully they're able to get you sorted!