Skip to content

Commit 1e7111f

Browse files
committed
ref(boto3): Rename span origin to auto.aws.boto3
1 parent 6c430fb commit 1e7111f

4 files changed

Lines changed: 6 additions & 20 deletions

File tree

‎sentry_sdk/integrations/boto3/_instrumentation.py‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,16 @@ def _start_client_span(
167167
with capture_internal_exceptions():
168168
attributes.update(_get_client_attributes(ctx))
169169

170-
# `sentry.op` and `sentry.origin` are set to generic defaults;
171-
# a service extension can override them with `get_span_op()` and `get_span_origin()`.
172-
span_op = OP.RPC
173-
span_origin = ORIGIN
170+
# `sentry.op` is set to a generic default, which a service extension can override
171+
# with `get_span_op()`.
172+
span_op = OP.HTTP_CLIENT
174173

175174
if service_ext is not None:
176175
with capture_internal_exceptions():
177176
service_op = service_ext.get_span_op(ctx)
178177
if service_op is not None:
179178
span_op = service_op
180179

181-
with capture_internal_exceptions():
182-
service_origin = service_ext.get_span_origin(ctx)
183-
if service_origin is not None:
184-
span_origin = service_origin
185-
186180
with capture_internal_exceptions():
187181
attributes.update(service_ext.get_request_attributes(ctx))
188182

@@ -191,7 +185,7 @@ def _start_client_span(
191185
attributes.update(
192186
{
193187
SPANDATA.SENTRY_OP: span_op,
194-
SPANDATA.SENTRY_ORIGIN: span_origin,
188+
SPANDATA.SENTRY_ORIGIN: ORIGIN,
195189
}
196190
)
197191
return sentry_sdk.start_span(

‎sentry_sdk/integrations/boto3/_services/base.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ def get_span_op(self, ctx: "AwsCallContext") -> "Optional[str]":
2121
"""Return an optional `sentry.op` override, or `None` to keep the default."""
2222
return None
2323

24-
def get_span_origin(self, ctx: "AwsCallContext") -> "Optional[str]":
25-
"""Return an optional `sentry.origin` override, or `None` to keep the default."""
26-
return None
27-
2824
def get_request_attributes(self, ctx: "AwsCallContext") -> "Attributes":
2925
"""Return request attributes to add before the AWS request is made."""
3026
return {}

‎sentry_sdk/integrations/boto3/consts.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
IDENTIFIER = "boto3"
2-
ORIGIN = f"auto.http.{IDENTIFIER}"
2+
ORIGIN = f"auto.aws.{IDENTIFIER}"
33
CLOUD_PROVIDER = "aws"
44

55
# value is used by `rpc.system` (deprecated in OTel, but we still support it for now) and `rpc.system.name`

‎tests/integrations/boto3/test_client.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,6 @@ class TestServiceExtension(_ServiceExtension):
442442
def get_span_op(self, ctx):
443443
return "aws.test"
444444

445-
def get_span_origin(self, ctx):
446-
return "auto.aws.test"
447-
448445
def get_request_attributes(self, ctx):
449446
return {
450447
"aws.test.request": ctx.params["Key"],
@@ -476,7 +473,6 @@ def get_response_attributes(self, ctx, response):
476473
spans_by_op = _capture_boto3_spans_by_op(
477474
lambda: client.head_object(**api_params),
478475
capture_items,
479-
expected_origin="auto.aws.test",
480476
)
481477

482478
spans = spans_by_op.get("aws.test", [])
@@ -486,7 +482,7 @@ def get_response_attributes(self, ctx, response):
486482
assert span["name"] == "S3.HeadObject"
487483
assert span.get("end_timestamp") is not None
488484
assert attributes[SPANDATA.SENTRY_OP] == "aws.test"
489-
assert attributes[SPANDATA.SENTRY_ORIGIN] == "auto.aws.test"
485+
assert attributes[SPANDATA.SENTRY_ORIGIN] == "auto.aws.boto3"
490486
assert attributes[SPANDATA.SENTRY_KIND] == "producer"
491487
assert attributes[SPANDATA.CLOUD_PROVIDER] == CLOUD_PROVIDER
492488
assert attributes[SPANDATA.RPC_SYSTEM_NAME] == AWS_RPC_SYSTEM_NAME

0 commit comments

Comments
 (0)