Skip to content

Commit

Permalink
update reset logic per lib recomendation
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Lai committed Jan 11, 2024
1 parent 1a7cf81 commit 4e13023
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Profiler/DatadogProfiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Sourceability\Instrumentation\Profiler;

use DDTrace\Tracer;
use function dd_trace_env_config;
use DDTrace\Contracts\Scope;
use DDTrace\GlobalTracer;
Expand Down Expand Up @@ -85,7 +86,13 @@ public function stopAndIgnore(): void
return;
}

GlobalTracer::get()->reset();
$this->scope = null;

// https://github.com/DataDog/dd-trace-php/issues/1533#issuecomment-1059211743
ini_set('datadog.trace.enabled', '0');
ini_set('datadog.trace.enabled', '1');

GlobalTracer::set(new Tracer());
}

private function isEnabled(): bool
Expand Down

0 comments on commit 4e13023

Please sign in to comment.