Skip to content

[do not merge] Testing merge - #7798

Merged
sentrivana merged 12 commits into
major/3.0from
ivana/major/test-merge-7
Oct 1, 2026
Merged

sentrivana merged 12 commits into
major/3.0from
ivana/major/test-merge-7

Conversation

@sentrivana

Copy link
Copy Markdown
Collaborator

No description provided.

The ASGI integration sets the parameterized path as the transaction name from the ASGI scope "route" property.
Starlette started setting the property in new versions.
There is no import of `anyio` in `test_starlette.py` and the pin leads to unsatisfiable constraints.

Closes #7778
Co-authored-by: Alexander Alderman Webb <alexander.webb@sentry.io>
### Description
Move `Boto3Integration` from single module into package with smaller
internal modules.

- botocore client patching is moved into `_client.py`.
- request instrumentation and event handlers into `_instrumentation.py`.
- existing public import is kept unchanged: `from
sentry_sdk.integrations.boto3 import Boto3Integration`.
### Description
Finish boto streaming spans when a `StreamingBody` is consumed, closed
or fails. Previously, streaming spans where only finished when a read
returned no data or `StreamingBody.close()` was called.
### Description

Move boto3 span creation from individual HTTP request attempts to full
botocore client-call lifecycle.

Previously, the client span was created from the botocore
`request-created` event; since botocore creates a new `AwsRequest` event
for every retry, these spans represent individual retries rather than
the full event. Following OTel
([https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans/#rpc-client-span](<https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans/#rpc-client-span>))
the span should cover the entire call lifecycle including all retries.
Wrapping `_make_api_call()` covers all retries performed by botocore,
including serialization, endpoint resolution, the final response or
failures
([https://github.com/boto/botocore/blob/develop/botocore/client.py:999](<https://github.com/boto/botocore/blob/develop/botocore/client.py:999>)).

* patch `BaseClient._make_api_call()` so one span represents a single
boto operation; this span is also kept active across every retry
attempt.
* `request-created` is kept for breadcrumbs, HTTP request attributes,
and trace propagation.
* client spans that fail will preserve the original exception.
* responses that return a `StreamingBody` are kept open until body is
consumed or closed.
* fix the correct parent/child relationship between boto, HTTP, and
streaming spans.<br><br>

#### Issues

Resolves #7474
### Description
Implements #7475  by adding common OTel attributes to boto client spans.


### Changes
- add the following attributes: `rpc.system.name`, `rpc.service`,
`rpc.method`, `cloud.region`, `server.address`, `server.port`.
- set `rpc.system.name` to `aws-api`
- changing span name to `Service.Operation` (now it's
`aws.<service>.<Operation>`), e.g. `S3.HeadObject` following OTel is a
breaking change and will be done in major.
- use modeled AWS service for `rpc.service`; not supported anymore by
OTel, but JS keeps this too.
- use boto operation name for `rpc.method`.
- extend `AwsCallContext` to carry extra client metadata for
instrumentation.

#### Issues
Resolves #7475
### Description
Add generic response, retry, and error attribute enrichment to boto3
spans. Previously, only recorded request and client metadata was
instrumented; information after the call such as HTTP status, retry
count, etc was omitted. The new attributes follow the [OTel AWS SDK
conventions](https://opentelemetry.io/docs/specs/semconv/cloud-providers/aws-sdk/).

### Changes
- add `SPANDATA` consts: `AWS_REQUEST_ID`, `AWS_EXTENDED_REQUEST_ID`,
`HTTP_REQUEST_RESEND_COUNT`, and `ERROR_TYPE`.
- add `_get_response_attributes()` to extract
`http.response_status_code`, `http.request_resend_count`,
`aws.request_id`, and `aws.extended_request_id`.
- Add `erorr.type` from `ClientError.Eror.Code` or the exception class,
without recording error messages.

#### Issues
Resolves #7476
@sentrivana
sentrivana force-pushed the ivana/major/test-merge-7 branch 2 times, most recently from 160cdf4 to 06d4e14 Compare October 1, 2026 08:41
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 58919 passed | ⏭️ 2727 skipped | Total: 61646 | Pass Rate: 95.58% | Execution Time: 163m 37s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -75410
Passed Tests 📉 -70915
Failed Tests 📉 -2
Skipped Tests 📉 -4493

➖ Removed Tests (1)

View removed tests
  • test_binary_content_encoding_image_url[True-False]
    • File: tests.integrations.litellm.test_litellm

All tests are passing successfully.

✅ Patch coverage is 93.97%. Project has 2074 uncovered lines.
❌ Project coverage is 90.17%. Comparing base (629f642) to head (07db984).

Files with missing lines (5)
File Patch % Lines
sentry_sdk/integrations/boto3/_instrumentation.py 92.31% ⚠️ 16 Missing and 12 partials
sentry_sdk/integrations/boto3/_client.py 95.45% ⚠️ 3 Missing and 1 partials
sentry_sdk/integrations/boto3/_context.py 97.30% ⚠️ 1 Missing and 3 partials
sentry_sdk/integrations/boto3/init.py 87.50% ⚠️ 2 Missing
sentry_sdk/integrations/aiohttp.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.34%    90.17%    -0.17%
==========================================
  Files          199       183       -16
  Lines        26524     21101     -5423
  Branches      9864      7400     -2464
==========================================
+ Hits         23962     19027     -4935
- Misses        2562      2074      -488
- Partials      1495      1230      -265

Generated by Codecov Action

@sentrivana
sentrivana force-pushed the ivana/major/test-merge-7 branch 3 times, most recently from bf9a487 to d4792ef Compare October 1, 2026 09:40
@sentrivana
sentrivana force-pushed the ivana/major/test-merge-7 branch from d4792ef to 07db984 Compare October 1, 2026 09:46
@sentrivana
sentrivana merged commit 07db984 into major/3.0 Oct 1, 2026
143 of 144 checks passed
@sentrivana
sentrivana deleted the ivana/major/test-merge-7 branch October 1, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants