Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<ServiceID>.<Operation>` (for example, `S3.GetObject` or `DynamoDB.GetItem`), following OpenTelemetry semantic conventions. Previously, spans were named `aws.<service-id>.<Operation>` (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 `<ServiceID>.<Operation>` (for example, `S3.GetObject` or `DynamoDB.GetItem`), following OpenTelemetry semantic conventions. Previously, spans were named `aws.<service-id>.<Operation>` (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.
Expand Down
12 changes: 3 additions & 9 deletions sentry_sdk/integrations/boto3/_instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,22 +167,16 @@ 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():
service_op = service_ext.get_span_op(ctx)
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))

Expand All @@ -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(
Expand Down
4 changes: 0 additions & 4 deletions sentry_sdk/integrations/boto3/_services/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/boto3/consts.py
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
6 changes: 1 addition & 5 deletions tests/integrations/boto3/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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", [])
Expand All @@ -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
Expand Down
Loading