Skip to content

Commit d4792ef

Browse files
committed
Merge branch 'master' into major/3.0
2 parents 629f642 + bc11cb7 commit d4792ef

24 files changed

Lines changed: 6325 additions & 4740 deletions

‎scripts/populate_tox/config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
"package": "huggingface_hub",
236236
"deps": {
237237
"*": ["responses", "pytest-httpx"],
238+
">=2": ["httpx2-pytest"],
238239
},
239240
},
240241
"langchain-base": {
@@ -472,7 +473,6 @@
472473
"pytest-asyncio",
473474
"python-multipart",
474475
"requests",
475-
"anyio<4.0.0",
476476
"jinja2",
477477
"httpx",
478478
],

‎scripts/populate_tox/package_dependencies.jsonl‎

Lines changed: 250 additions & 231 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/populate_tox/releases.jsonl‎

Lines changed: 74 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sentry_sdk/consts.py‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,18 @@ class SPANDATA:
359359
Example: ["Token limit exceeded"]
360360
"""
361361

362+
AWS_EXTENDED_REQUEST_ID = "aws.extended_request_id"
363+
"""
364+
The AWS extended request ID as returned in the response headers.
365+
Example: "wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ="
366+
"""
367+
368+
AWS_REQUEST_ID = "aws.request_id"
369+
"""
370+
The AWS request ID as returned in the response headers.
371+
Example: "79b9da39-b7ae-508a-a6bc-864b2829c622"
372+
"""
373+
362374
CACHE_HIT = "cache.hit"
363375
"""
364376
A boolean indicating whether the requested data was found in the cache.
@@ -383,6 +395,12 @@ class SPANDATA:
383395
Example: "10.1.2.80"
384396
"""
385397

398+
CLOUD_REGION = "cloud.region"
399+
"""
400+
The geographical region the resource is running.
401+
Example: "us-east-1"
402+
"""
403+
386404
CODE_FILEPATH = "code.filepath"
387405
"""
388406
.. deprecated::
@@ -510,6 +528,12 @@ class SPANDATA:
510528
Example: my_user
511529
"""
512530

531+
ERROR_TYPE = "error.type"
532+
"""
533+
Describes a class of error the operation ended with.
534+
Example: "timeout"
535+
"""
536+
513537
GEN_AI_AGENT_NAME = "gen_ai.agent.name"
514538
"""
515539
The name of the agent being used.
@@ -855,6 +879,12 @@ class SPANDATA:
855879
Example: GET
856880
"""
857881

882+
HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count"
883+
"""
884+
The ordinal number of request resending attempt (for any reason, including redirects).
885+
Example: 2
886+
"""
887+
858888
HTTP_ROUTE = "http.route"
859889
"""
860890
The matched route, that is, the path template used to match the request.
@@ -952,12 +982,24 @@ class SPANDATA:
952982
Example: "com.example.ExampleService/exampleMethod"
953983
"""
954984

985+
RPC_SERVICE = "rpc.service"
986+
"""
987+
The full (logical) name of the service being called, including its package name, if applicable.
988+
Example: "myService.BestService"
989+
"""
990+
955991
RPC_RESPONSE_STATUS_CODE = "rpc.response.status_code"
956992
"""
957993
Status code of the RPC returned by the RPC server or generated by the client.
958994
Example: "DEADLINE_EXCEEDED"
959995
"""
960996

997+
RPC_SYSTEM_NAME = "rpc.system.name"
998+
"""
999+
A string identifying the remoting system.
1000+
Example: "aws-api"
1001+
"""
1002+
9611003
SERVER_ADDRESS = "server.address"
9621004
"""
9631005
Name of the database host.
@@ -1147,6 +1189,18 @@ class SPANDATA:
11471189
Used in inbound filters.
11481190
"""
11491191

1192+
SENTRY_OP = "sentry.op"
1193+
"""
1194+
The operation of a span.
1195+
Example: "http.client"
1196+
"""
1197+
1198+
SENTRY_ORIGIN = "sentry.origin"
1199+
"""
1200+
The origin of the instrumentation (e.g. span, log, etc.)
1201+
Example: "auto.http.otel.fastify"
1202+
"""
1203+
11501204
SENTRY_RELEASE = "sentry.release"
11511205
"""
11521206
The Sentry release.
@@ -1177,6 +1231,13 @@ class SPANDATA:
11771231
Example: ["AtexitIntegration", "StdlibIntegration"]
11781232
"""
11791233

1234+
USER_AGENT_ORIGINAL = "user_agent.original"
1235+
"""
1236+
Value of the HTTP User-Agent header sent by the client.
1237+
1238+
Used in inbound filters.
1239+
"""
1240+
11801241

11811242
class OP:
11821243
ANTHROPIC_MESSAGES_CREATE = "ai.messages.create.anthropic"

‎sentry_sdk/integrations/aiohttp.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ async def sentry_app_handle(
139139
),
140140
)
141141

142+
user_agent = request.headers.get("User-Agent")
143+
if user_agent:
144+
scope.set_attribute(SPANDATA.USER_AGENT_ORIGINAL, user_agent)
145+
142146
headers = dict(request.headers)
143147

144148
sentry_sdk.continue_trace(headers)

‎sentry_sdk/integrations/boto3.py‎

Lines changed: 0 additions & 221 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
2+
from sentry_sdk.integrations.boto3._client import _patch_botocore_client
3+
from sentry_sdk.integrations.boto3.consts import IDENTIFIER, ORIGIN
4+
from sentry_sdk.utils import parse_version
5+
6+
try:
7+
from botocore import __version__ as BOTOCORE_VERSION
8+
except ImportError:
9+
raise DidNotEnable("botocore is not installed")
10+
11+
12+
class Boto3Integration(Integration):
13+
identifier = IDENTIFIER
14+
origin = ORIGIN
15+
16+
@staticmethod
17+
def setup_once() -> None:
18+
version = parse_version(BOTOCORE_VERSION)
19+
_check_minimum_version(Boto3Integration, version, "botocore")
20+
21+
_patch_botocore_client()

0 commit comments

Comments
 (0)