Skip to content

Commit e4f0f15

Browse files
committed
Modify import of Ramsey UUID
1 parent 73e34bf commit e4f0f15

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Spanner/src/SpannerClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
use OpenTelemetry\SDK\Metrics\MetricReader\ExportingReader;
5555
use Psr\Cache\CacheItemPoolInterface;
5656
use Psr\Http\Message\StreamInterface;
57-
use Ramsey\Uuid\Uuid as UUID;
57+
use Ramsey\Uuid\Uuid as RUUID;
5858

5959
/**
6060
* Cloud Spanner is a highly scalable, transactional, managed, NewSQL
@@ -1046,7 +1046,7 @@ private function configureBuiltinMetrics(bool $disabled): void
10461046
}
10471047

10481048
$metricsClient = new MetricServiceClient();
1049-
$metricsClientId = UUID::uuid4()->toString() . '-' . getmypid();
1049+
$metricsClientId = RUUID::uuid4()->toString() . '-' . getmypid();
10501050
$exporter = new BuiltInMetricsExporter($metricsClient, $this->projectId, $metricsClientId);
10511051
$reader = new ExportingReader($exporter);
10521052
$this->meterProvider = MeterProvider::builder()

Spanner/tests/Unit/OpenTelemetry/BuiltInMetricsExporterTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function testExport()
7676

7777
$scope = new InstrumentationScope('google-cloud-spanner', '1.0.0', null, Attributes::create([]));
7878
$resource = ResourceInfo::create(Attributes::create(['service.name' => 'spanner']));
79-
79+
8080
$attributes = Attributes::create([
8181
'method' => 'ExecuteSql',
8282
'status' => 'OK',
@@ -98,14 +98,14 @@ public function testExport()
9898
if (!$request instanceof CreateTimeSeriesRequest) {
9999
return false;
100100
}
101-
101+
102102
$projectName = MetricServiceClient::projectName(self::PROJECT_ID);
103103
if ($request->getName() !== $projectName) {
104104
return false;
105105
}
106106

107107
$timeSeries = $request->getTimeSeries()[0];
108-
108+
109109
// Verify Metric Type
110110
$expectedMetric = 'spanner.googleapis.com/internal/client/attempt_count';
111111
if ($timeSeries->getMetric()->getType() !== $expectedMetric) {
@@ -114,7 +114,7 @@ public function testExport()
114114

115115
// Verify Labels
116116
$labels = $timeSeries->getMetric()->getLabels();
117-
if ($labels['method'] !== 'ExecuteSql' ||
117+
if ($labels['method'] !== 'ExecuteSql' ||
118118
$labels['status'] !== 'OK' ||
119119
$labels['database'] !== 'my-db') {
120120
return false;
@@ -125,7 +125,7 @@ public function testExport()
125125
if ($resLabels['instance_id'] !== 'my-instance') {
126126
return false;
127127
}
128-
128+
129129
// Verify Client Hash
130130
if ($resLabels['client_hash'] !== '000369') {
131131
return false;

0 commit comments

Comments
 (0)