Skip to content

Commit 5f3a9ed

Browse files
committed
Updated to use the latest semcov 1.32
1 parent 1cdadb9 commit 5f3a9ed

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Instrumentation/AwsSdk/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"aws/aws-sdk-php": "^3",
1414
"ext-opentelemetry": "*",
1515
"open-telemetry/api": "^1.0",
16-
"open-telemetry/sem-conv": "^1.30"
16+
"open-telemetry/sem-conv": "^1.32"
1717
},
1818
"require-dev": {
1919
"friendsofphp/php-cs-fixer": "^3",

src/Instrumentation/AwsSdk/src/AwsSdkInstrumentation.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function register(): void
2525
$inst = new CachedInstrumentation(
2626
'io.opentelemetry.contrib.php.aws-sdk',
2727
null,
28-
'https://opentelemetry.io/schemas/1.30.0',
28+
'https://opentelemetry.io/schemas/1.32.0',
2929
);
3030

3131
/**
@@ -51,9 +51,8 @@ public static function register(): void
5151
->setAttribute(TraceAttributes::RPC_METHOD, $cmd->getName())
5252
->setAttribute(TraceAttributes::RPC_SERVICE, $c->getApi()->getServiceName())
5353
->setAttribute(TraceAttributes::CLOUD_REGION, $c->getRegion())
54-
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, $function)
55-
->setAttribute(TraceAttributes::CODE_NAMESPACE, $class)
56-
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
54+
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, sprintf('%s::%s', $class, $function))
55+
->setAttribute(TraceAttributes::CODE_FILE_PATH, $filename)
5756
->setAttribute(TraceAttributes::CODE_LINE_NUMBER, $lineno);
5857

5958
$span = $builder->startSpan();

src/Instrumentation/AwsSdk/tests/Integration/AwsSdkInstrumentationTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ public function test_listBuckets_generates_one_aws_span_with_expected_attributes
7373
$this->assertSame('s3.ListBuckets', $span->getName());
7474

7575
$attrs = $span->getAttributes();
76+
$this->assertSame('Aws\AwsClient::execute', $attrs->get('code.function.name'));
7677
$this->assertSame('aws-api', $attrs->get('rpc.system'));
7778
$this->assertSame('s3', $attrs->get('rpc.service'));
7879
$this->assertSame('ListBuckets', $attrs->get('rpc.method'));
79-
$this->assertSame('us-west-2', $attrs->get('aws.region'));
80-
$this->assertSame(200, $attrs->get('http.status_code'));
81-
$this->assertSame('TEST-REQUEST-ID', $attrs->get('aws.requestId'));
80+
$this->assertSame('us-west-2', $attrs->get('cloud.region'));
81+
$this->assertSame(200, $attrs->get('http.response.status_code'));
82+
$this->assertSame('TEST-REQUEST-ID', $attrs->get('aws.request_id'));
8283
}
8384
}

0 commit comments

Comments
 (0)