diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 6b10de08d6..01e164fb9b 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -46,7 +46,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh - The `RustTracingIntegration` no longer includes the values of tracing fields if `send_default_pii` is enabled. Pass `include_tracing_fields=True` to the integration to include them. - Whether the Dramatiq integration attaches message bodies to events is now controlled by `data_collection`'s `queues` setting instead of `http_bodies`. - The Celery integration no longer sets the status of task spans to error when a task raises a control flow exception (`Retry`, `Ignore`, or `Reject`). -- The boto3 integration now names spans `.` (for example, `S3.GetObject` or `DynamoDB.GetItem`), following OpenTelemetry semantic conventions. Previously, spans were named `aws..` (for example, `aws.s3.GetObject`). Update any alerts, dashboards, or `ignore_spans` rules that match on the old names. +- The boto3 integration now names spans `.` (for example, `S3.GetObject` or `DynamoDB.GetItem`), following OpenTelemetry semantic conventions. Previously, spans were named `aws..` (for example, `aws.s3.GetObject`). Its spans, including the span for reading a streamed response body, now also have the origin `auto.aws.boto3` instead of `auto.http.boto3`. Update any alerts, dashboards, or `ignore_spans` rules that match on the old names or origin. - Enabling an AI agent integration (LangChain, OpenAI Agents, or Pydantic AI) no longer disables the OpenAI, Anthropic, and Google GenAI integrations. Instead, those integrations don't create chat spans for requests made from within an agent framework's chat span, but still create other spans, such as embedding spans. The LangChain integration no longer instruments embeddings directly; embedding spans are now created by the integration of the underlying client library. - Whether the MCP integration records tool arguments, tool results, and prompt contents is now controlled by `data_collection`'s new `mcp` setting (`{"inputs": bool, "outputs": bool}`, both `True` by default) instead of the `gen_ai` setting. - With `handled_tool_call_exceptions=True` (the default), the Pydantic AI integration now reports an error for every failed tool argument validation attempt, including retries. Previously, only one error was reported per tool call. diff --git a/sentry_sdk/integrations/boto3/_instrumentation.py b/sentry_sdk/integrations/boto3/_instrumentation.py index fab0122ccb..731dac6fa3 100644 --- a/sentry_sdk/integrations/boto3/_instrumentation.py +++ b/sentry_sdk/integrations/boto3/_instrumentation.py @@ -167,10 +167,9 @@ def _start_client_span( with capture_internal_exceptions(): attributes.update(_get_client_attributes(ctx)) - # `sentry.op` and `sentry.origin` are set to generic defaults; - # a service extension can override them with `get_span_op()` and `get_span_origin()`. + # `sentry.op` is set to a generic default, which a service extension can override + # with `get_span_op()`. span_op = OP.RPC - span_origin = ORIGIN if service_ext is not None: with capture_internal_exceptions(): @@ -178,11 +177,6 @@ def _start_client_span( if service_op is not None: span_op = service_op - with capture_internal_exceptions(): - service_origin = service_ext.get_span_origin(ctx) - if service_origin is not None: - span_origin = service_origin - with capture_internal_exceptions(): attributes.update(service_ext.get_request_attributes(ctx)) @@ -191,7 +185,7 @@ def _start_client_span( attributes.update( { SPANDATA.SENTRY_OP: span_op, - SPANDATA.SENTRY_ORIGIN: span_origin, + SPANDATA.SENTRY_ORIGIN: ORIGIN, } ) return sentry_sdk.start_span( diff --git a/sentry_sdk/integrations/boto3/_services/base.py b/sentry_sdk/integrations/boto3/_services/base.py index 0d9cb1c24d..ec7ac1df1c 100644 --- a/sentry_sdk/integrations/boto3/_services/base.py +++ b/sentry_sdk/integrations/boto3/_services/base.py @@ -21,10 +21,6 @@ def get_span_op(self, ctx: "AwsCallContext") -> "Optional[str]": """Return an optional `sentry.op` override, or `None` to keep the default.""" return None - def get_span_origin(self, ctx: "AwsCallContext") -> "Optional[str]": - """Return an optional `sentry.origin` override, or `None` to keep the default.""" - return None - def get_request_attributes(self, ctx: "AwsCallContext") -> "Attributes": """Return request attributes to add before the AWS request is made.""" return {} diff --git a/sentry_sdk/integrations/boto3/consts.py b/sentry_sdk/integrations/boto3/consts.py index 29d5cc6dbb..29f1ced1f6 100644 --- a/sentry_sdk/integrations/boto3/consts.py +++ b/sentry_sdk/integrations/boto3/consts.py @@ -1,5 +1,5 @@ IDENTIFIER = "boto3" -ORIGIN = f"auto.http.{IDENTIFIER}" +ORIGIN = f"auto.aws.{IDENTIFIER}" CLOUD_PROVIDER = "aws" # value is used by `rpc.system` (deprecated in OTel, but we still support it for now) and `rpc.system.name` diff --git a/tests/integrations/boto3/test_client.py b/tests/integrations/boto3/test_client.py index 163fc515bc..999d3876f4 100644 --- a/tests/integrations/boto3/test_client.py +++ b/tests/integrations/boto3/test_client.py @@ -442,9 +442,6 @@ class TestServiceExtension(_ServiceExtension): def get_span_op(self, ctx): return "aws.test" - def get_span_origin(self, ctx): - return "auto.aws.test" - def get_request_attributes(self, ctx): return { "aws.test.request": ctx.params["Key"], @@ -476,7 +473,6 @@ def get_response_attributes(self, ctx, response): spans_by_op = _capture_boto3_spans_by_op( lambda: client.head_object(**api_params), capture_items, - expected_origin="auto.aws.test", ) spans = spans_by_op.get("aws.test", []) @@ -486,7 +482,7 @@ def get_response_attributes(self, ctx, response): assert span["name"] == "S3.HeadObject" assert span.get("end_timestamp") is not None assert attributes[SPANDATA.SENTRY_OP] == "aws.test" - assert attributes[SPANDATA.SENTRY_ORIGIN] == "auto.aws.test" + assert attributes[SPANDATA.SENTRY_ORIGIN] == "auto.aws.boto3" assert attributes[SPANDATA.SENTRY_KIND] == "producer" assert attributes[SPANDATA.CLOUD_PROVIDER] == CLOUD_PROVIDER assert attributes[SPANDATA.RPC_SYSTEM_NAME] == AWS_RPC_SYSTEM_NAME