diff --git a/src/Collectors/SegmentCollector.php b/src/Collectors/SegmentCollector.php index 57a196e..d9a2ca8 100644 --- a/src/Collectors/SegmentCollector.php +++ b/src/Collectors/SegmentCollector.php @@ -54,6 +54,7 @@ public function initHttpTracer(Request $request): void ->setName(config('xray.name') ?? config('app.name')) ->setClientIpAddress($request->ip()) ->setUrl($request->url()) + ->setUserAgent(substr($_SERVER['HTTP_USER_AGENT'] ?? '', 0, 300)) ->setMethod($request->method()); $tracer->begin($this->getSampleRate());