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 8618736
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 @@ -8,6 +8,7 @@
use DDTrace\Contracts\Scope;
use DDTrace\GlobalTracer;
use DDTrace\Tag;
use DDTrace\Tracer;
use DDTrace\Type;
use function ddtrace_config_app_name;
use function ddtrace_config_trace_enabled;
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 8618736

Please sign in to comment.