diff --git a/src/Prometheus/CollectorRegistry.php b/src/Prometheus/CollectorRegistry.php index 1a0be51..91d6ad2 100644 --- a/src/Prometheus/CollectorRegistry.php +++ b/src/Prometheus/CollectorRegistry.php @@ -99,7 +99,7 @@ public function registerGauge(string $namespace, string $name, string $help, arr { $metricIdentifier = self::metricIdentifier($namespace, $name); if (isset($this->gauges[$metricIdentifier])) { - throw new MetricsRegistrationException("Metric already registered"); + throw new MetricsRegistrationException("Metric ` . $metricIdentifier . ` already registered"); } $this->gauges[$metricIdentifier] = new Gauge( $this->storageAdapter, @@ -159,7 +159,7 @@ public function registerCounter(string $namespace, string $name, string $help, a { $metricIdentifier = self::metricIdentifier($namespace, $name); if (isset($this->counters[$metricIdentifier])) { - throw new MetricsRegistrationException("Metric already registered"); + throw new MetricsRegistrationException("Metric ` . $metricIdentifier . ` already registered"); } $this->counters[$metricIdentifier] = new Counter( $this->storageAdapter, @@ -225,7 +225,7 @@ public function registerHistogram( ): Histogram { $metricIdentifier = self::metricIdentifier($namespace, $name); if (isset($this->histograms[$metricIdentifier])) { - throw new MetricsRegistrationException("Metric already registered"); + throw new MetricsRegistrationException("Metric ` . $metricIdentifier . ` already registered"); } $this->histograms[$metricIdentifier] = new Histogram( $this->storageAdapter, @@ -301,7 +301,7 @@ public function registerSummary( ): Summary { $metricIdentifier = self::metricIdentifier($namespace, $name); if (isset($this->summaries[$metricIdentifier])) { - throw new MetricsRegistrationException("Metric already registered"); + throw new MetricsRegistrationException("Metric ` . $metricIdentifier . ` already registered"); } $this->summaries[$metricIdentifier] = new Summary( $this->storageAdapter,