Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 2b18657

Browse files
author
billpyang
committed
fix:完善代码结构
1 parent 3e852de commit 2b18657

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

src/Facades/Metric.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* @method static bool isEnabled()
1111
* @method static void reset()
1212
* @method static \OpenTelemetry\API\Metrics\MeterInterface meter()
13-
* @method static \OpenTelemetry\API\Metrics\CounterInterface createCounter(string $name, ?string $unit = null, ?string $description = null, array $advisory = [])
14-
* @method static \OpenTelemetry\API\Metrics\HistogramInterface createHistogram(string $name, ?string $unit = null, ?string $description = null, array $advisory = [])
15-
* @method static \OpenTelemetry\API\Metrics\GaugeInterface createGauge(string $name, ?string $unit = null, ?string $description = null, array $advisory = [])
16-
* @method static \OpenTelemetry\API\Metrics\ObservableGaugeInterface createObservableGauge(string $name, ?string $unit = null, ?string $description = null, array|callable $advisory = [], callable ...$callbacks)
13+
* @method static \OpenTelemetry\API\Metrics\CounterInterface counter(string $name, ?string $unit = null, ?string $description = null, array $advisories = [])
14+
* @method static \OpenTelemetry\API\Metrics\HistogramInterface histogram(string $name, ?string $unit = null, ?string $description = null, array $advisories = [])
15+
* @method static \OpenTelemetry\API\Metrics\GaugeInterface gauge(string $name, ?string $unit = null, ?string $description = null, array $advisories = [])
16+
* @method static \OpenTelemetry\API\Metrics\ObservableGaugeInterface observableGauge(string $name, ?string $unit = null, ?string $description = null, array|callable $advisories = [], callable ...$callbacks)
1717
*
1818
* @see \Overtrue\LaravelOpenTelemetry\Support\Metric
1919
*/

src/OpenTelemetryServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use OpenTelemetry\API\Trace\TracerInterface;
1515
use Overtrue\LaravelOpenTelemetry\Console\Commands\TestCommand;
1616
use Overtrue\LaravelOpenTelemetry\Facades\Measure;
17-
use Overtrue\LaravelOpenTelemetry\Facades\Metric;
1817
use Overtrue\LaravelOpenTelemetry\Http\Middleware\AddTraceId;
1918
use Overtrue\LaravelOpenTelemetry\Http\Middleware\TraceRequest;
2019

src/Support/Metric.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,27 @@ public function meter(): MeterInterface
6363
}
6464
}
6565

66-
public function createCounter(string $name, ?string $unit = null,
67-
?string $description = null, array $advisory = []): CounterInterface
66+
public function counter(string $name, ?string $unit = null,
67+
?string $description = null, array $advisories = []): CounterInterface
6868
{
69-
return $this->meter()->createCounter($name, $unit, $description, $advisory);
69+
return $this->meter()->createCounter($name, $unit, $description, $advisories);
7070
}
7171

72-
public function createHistogram(string $name, ?string $unit = null,
73-
?string $description = null, array $advisory = []): HistogramInterface
72+
public function histogram(string $name, ?string $unit = null,
73+
?string $description = null, array $advisories = []): HistogramInterface
7474
{
75-
return $this->meter()->createHistogram($name, $unit, $description, $advisory);
75+
return $this->meter()->createHistogram($name, $unit, $description, $advisories);
7676
}
7777

78-
public function createGauge(string $name, ?string $unit = null,
79-
?string $description = null, array $advisory = []): GaugeInterface
78+
public function gauge(string $name, ?string $unit = null,
79+
?string $description = null, array $advisories = []): GaugeInterface
8080
{
81-
return $this->meter()->createGauge($name, $unit, $description, $advisory);
81+
return $this->meter()->createGauge($name, $unit, $description, $advisories);
8282
}
8383

84-
public function createObservableGauge(string $name, ?string $unit = null,
85-
?string $description = null, array|callable $advisory = [], callable ...$callbacks): ObservableGaugeInterface
84+
public function observableGauge(string $name, ?string $unit = null,
85+
?string $description = null, array|callable $advisories = [], callable ...$callbacks): ObservableGaugeInterface
8686
{
87-
return $this->meter()->createObservableGauge($name, $unit, $description, $advisory, $callbacks);
87+
return $this->meter()->createObservableGauge($name, $unit, $description, $advisories, ...$callbacks);
8888
}
8989
}

0 commit comments

Comments
 (0)