Skip to content

Commit 926afd7

Browse files
Merge pull request #1 from PcComponentes/do-nothing-on-inactive
Do nothing when inactive
2 parents 9cef0d4 + e50fa11 commit 926afd7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/GuzzleHttp/ElasticApmMiddleware.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public static function trace(ElasticApmTracer $elasticApmTracer): \Closure
1616
{
1717
return static function (callable $handler) use ($elasticApmTracer) {
1818
return static function (Request $request, array $options) use ($handler, $elasticApmTracer) {
19+
if (false === $elasticApmTracer->active()) {
20+
return $handler($request, $options);
21+
}
22+
1923
$name = \sprintf(
2024
'%s %s',
2125
$request->getMethod(),

0 commit comments

Comments
 (0)