Skip to content

Commit ab09e30

Browse files
committed
fix(container): Make CollectorFactory singleton
1 parent b346a03 commit ab09e30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Contracts\Foundation\Application;
1010
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
1111
use Webmozart\Assert\Assert;
12+
use Zlodes\PrometheusClient\Collector\CollectorFactory;
1213
use Zlodes\PrometheusClient\Exporter\Exporter;
1314
use Zlodes\PrometheusClient\Exporter\StoredMetricsExporter;
1415
use Zlodes\PrometheusClient\KeySerialization\JsonSerializer;
@@ -30,6 +31,7 @@ public function register(): void
3031
{
3132
$this->mergeConfigFrom(__DIR__ . '/../config/prometheus-exporter.php', 'prometheus-exporter');
3233

34+
$this->app->singleton(CollectorFactory::class);
3335
$this->app->singleton(Registry::class, ArrayRegistry::class);
3436
$this->app->singleton(Exporter::class, StoredMetricsExporter::class);
3537

0 commit comments

Comments
 (0)