Skip to content

Commit

Permalink
Merge pull request #1 from PcComponentes/do-nothing-on-inactive
Browse files Browse the repository at this point in the history
Do nothing when inactive
  • Loading branch information
AaronBernabeu authored Jun 12, 2020
2 parents 9cef0d4 + e50fa11 commit 926afd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/GuzzleHttp/ElasticApmMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public static function trace(ElasticApmTracer $elasticApmTracer): \Closure
{
return static function (callable $handler) use ($elasticApmTracer) {
return static function (Request $request, array $options) use ($handler, $elasticApmTracer) {
if (false === $elasticApmTracer->active()) {
return $handler($request, $options);
}

$name = \sprintf(
'%s %s',
$request->getMethod(),
Expand Down

0 comments on commit 926afd7

Please sign in to comment.