Skip to content

Commit

Permalink
feat: useragent (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
evan361425 authored Jul 1, 2021
1 parent 8f95464 commit 2e84a74
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Collectors/SegmentCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 2e84a74

Please sign in to comment.