diff --git a/src/MonitorServiceProvider.php b/src/MonitorServiceProvider.php index 7a808e6..c273903 100644 --- a/src/MonitorServiceProvider.php +++ b/src/MonitorServiceProvider.php @@ -13,11 +13,11 @@ public function register(): void { $this->mergeConfigFrom(__DIR__.'/../config/monitor.php', 'monitor'); - $this->app->singleton(Monitor::class, fn () => new Monitor); - $this->app->singleton(Trace::class, fn () => new Trace); - $this->app->singleton(LogTimer::class, fn () => new LogTimer); - $this->app->singleton(CircuitBreaker::class, fn () => new CircuitBreaker); - $this->app->singleton(ControlledContext::class, fn () => new ControlledContext); + $this->app->scoped(Monitor::class, fn () => new Monitor); + $this->app->scoped(Trace::class, fn () => new Trace); + $this->app->scoped(LogTimer::class, fn () => new LogTimer); + $this->app->scoped(CircuitBreaker::class, fn () => new CircuitBreaker); + $this->app->scoped(ControlledContext::class, fn () => new ControlledContext); // Remove automatic logging channel merging - users should configure their own channels }