From 219f6d4bc312ce380ebea65ccf6302a2de46c10e Mon Sep 17 00:00:00 2001 From: Pablo Deputter Date: Tue, 6 Oct 2026 13:21:57 +0200 Subject: [PATCH 1/4] feat(boto3): Add `cloud.provider` attribute to `SPANDATA` --- sentry_sdk/consts.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 231e87a2c3..ec03f64fb9 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -393,6 +393,14 @@ class SPANDATA: Example: "10.1.2.80" """ + CLOUD_PROVIDER = "cloud.provider" + """ + Name of the cloud provider. + + Example: "aws" + """ + + CLOUD_REGION = "cloud.region" """ The geographical region the resource is running. From c495057d158cbce84687c0f2aaa655471163f32d Mon Sep 17 00:00:00 2001 From: Pablo Deputter Date: Tue, 6 Oct 2026 13:22:54 +0200 Subject: [PATCH 2/4] feat(boto3): Add `CLOUD_PROVIDER` const to `consts.py` --- sentry_sdk/integrations/boto3/consts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sentry_sdk/integrations/boto3/consts.py b/sentry_sdk/integrations/boto3/consts.py index 7d0d441257..865d85b80f 100644 --- a/sentry_sdk/integrations/boto3/consts.py +++ b/sentry_sdk/integrations/boto3/consts.py @@ -1,5 +1,6 @@ IDENTIFIER = "boto3" ORIGIN = f"auto.http.{IDENTIFIER}" +CLOUD_PROVIDER = "aws" # value is used by `rpc.system` (deprecated in OTel, but we still support it for now) and `rpc.system.name` # https://opentelemetry.io/docs/specs/semconv/cloud-providers/aws-sdk/#aws-sdk-spans @@ -10,3 +11,5 @@ "http": 80, "https": 443, } + + From 2f4ee558e3d16b219d7edc94f281294dfb37f61e Mon Sep 17 00:00:00 2001 From: Pablo Deputter Date: Tue, 6 Oct 2026 13:33:49 +0200 Subject: [PATCH 3/4] feat(boto3): Set `CLOUD_PROVIDER` attribute at span creation --- sentry_sdk/integrations/boto3/_instrumentation.py | 2 ++ tests/integrations/boto3/test_client.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/integrations/boto3/_instrumentation.py b/sentry_sdk/integrations/boto3/_instrumentation.py index b56540e5bb..8a05e3c544 100644 --- a/sentry_sdk/integrations/boto3/_instrumentation.py +++ b/sentry_sdk/integrations/boto3/_instrumentation.py @@ -6,6 +6,7 @@ from sentry_sdk.integrations import DidNotEnable from sentry_sdk.integrations.boto3.consts import ( AWS_RPC_SYSTEM_NAME, + CLOUD_PROVIDER, DEFAULT_PORTS, IDENTIFIER, ORIGIN, @@ -156,6 +157,7 @@ def _start_client_span( service_name = ctx.service_id or "unknown" span_name = f"{service_name}.{ctx.operation_name}" attributes: "Attributes" = { + SPANDATA.CLOUD_PROVIDER: CLOUD_PROVIDER, SPANDATA.RPC_METHOD: ctx.operation_name, SPANDATA.RPC_SYSTEM_NAME: AWS_RPC_SYSTEM_NAME, # all client call spans are by default "client" spans. diff --git a/tests/integrations/boto3/test_client.py b/tests/integrations/boto3/test_client.py index 9d20c192ca..1113833a80 100644 --- a/tests/integrations/boto3/test_client.py +++ b/tests/integrations/boto3/test_client.py @@ -14,7 +14,11 @@ from sentry_sdk.integrations.boto3 import Boto3Integration from sentry_sdk.integrations.boto3._services.base import _ServiceExtension from sentry_sdk.integrations.boto3._services.registry import _SERVICE_EXTENSIONS -from sentry_sdk.integrations.boto3.consts import AWS_RPC_SYSTEM_NAME, ORIGIN +from sentry_sdk.integrations.boto3.consts import ( + AWS_RPC_SYSTEM_NAME, + CLOUD_PROVIDER, + ORIGIN, +) from sentry_sdk.integrations.stdlib import StdlibIntegration from sentry_sdk.traces import Span from tests.integrations.boto3.aws_mock import Body, MockResponse @@ -432,6 +436,7 @@ def test_client_call_has_common_attributes( assert attributes[SPANDATA.RPC_SYSTEM_NAME] == AWS_RPC_SYSTEM_NAME assert attributes[SPANDATA.SENTRY_KIND] == "client" assert attributes[SPANDATA.CLOUD_REGION] == "eu-north-1" + assert attributes[SPANDATA.CLOUD_PROVIDER] == CLOUD_PROVIDER assert attributes[SPANDATA.SERVER_ADDRESS] == server_address assert attributes[SPANDATA.SERVER_PORT] == server_port assert attributes[SPANDATA.HTTP_STATUS_CODE] == 200 @@ -452,6 +457,7 @@ def test_client_call_attributes_are_available_at_span_creation( ignore_spans=[ { "attributes": { + SPANDATA.CLOUD_PROVIDER: CLOUD_PROVIDER, SPANDATA.RPC_METHOD: "HeadObject", SPANDATA.RPC_SERVICE: "S3", SPANDATA.RPC_SYSTEM_NAME: AWS_RPC_SYSTEM_NAME, From 3c7e221e1e5424de4e4c9d3a91935bda1d1b4cae Mon Sep 17 00:00:00 2001 From: Pablo Deputter Date: Tue, 6 Oct 2026 13:44:53 +0200 Subject: [PATCH 4/4] lint --- sentry_sdk/consts.py | 1 - sentry_sdk/integrations/boto3/consts.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index ec03f64fb9..5325b6f281 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -400,7 +400,6 @@ class SPANDATA: Example: "aws" """ - CLOUD_REGION = "cloud.region" """ The geographical region the resource is running. diff --git a/sentry_sdk/integrations/boto3/consts.py b/sentry_sdk/integrations/boto3/consts.py index 865d85b80f..29d5cc6dbb 100644 --- a/sentry_sdk/integrations/boto3/consts.py +++ b/sentry_sdk/integrations/boto3/consts.py @@ -11,5 +11,3 @@ "http": 80, "https": 443, } - -