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
4 changes: 3 additions & 1 deletion scripts/populate_tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
"package": "huggingface_hub",
"deps": {
"*": ["responses", "pytest-httpx"],
">=2": ["httpx2-pytest"],
},
},
"langchain-base": {
Expand Down Expand Up @@ -472,12 +473,13 @@
"pytest-asyncio",
"python-multipart",
"requests",
"anyio<4.0.0",
"jinja2",
"httpx",
],
# See the comment on FastAPI's httpx bound for more info
"<0.37.2": ["httpx<0.28.0"],
# Starlette <0.21 uses anyio.start_blocking_portal which was removed in anyio 4.
"<0.21": ["anyio<4"],
},
},
"starlite": {
Expand Down
481 changes: 250 additions & 231 deletions scripts/populate_tox/package_dependencies.jsonl

Large diffs are not rendered by default.

105 changes: 74 additions & 31 deletions scripts/populate_tox/releases.jsonl

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions sentry_sdk/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,18 @@ class SPANDATA:
Example: ["Token limit exceeded"]
"""

AWS_EXTENDED_REQUEST_ID = "aws.extended_request_id"
"""
The AWS extended request ID as returned in the response headers.
Example: "wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ="
"""

AWS_REQUEST_ID = "aws.request_id"
"""
The AWS request ID as returned in the response headers.
Example: "79b9da39-b7ae-508a-a6bc-864b2829c622"
"""

CACHE_HIT = "cache.hit"
"""
A boolean indicating whether the requested data was found in the cache.
Expand All @@ -383,6 +395,12 @@ class SPANDATA:
Example: "10.1.2.80"
"""

CLOUD_REGION = "cloud.region"
"""
The geographical region the resource is running.
Example: "us-east-1"
"""

CODE_FILEPATH = "code.filepath"
"""
.. deprecated::
Expand Down Expand Up @@ -510,6 +528,12 @@ class SPANDATA:
Example: my_user
"""

ERROR_TYPE = "error.type"
"""
Describes a class of error the operation ended with.
Example: "timeout"
"""

GEN_AI_AGENT_NAME = "gen_ai.agent.name"
"""
The name of the agent being used.
Expand Down Expand Up @@ -855,6 +879,12 @@ class SPANDATA:
Example: GET
"""

HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count"
"""
The ordinal number of request resending attempt (for any reason, including redirects).
Example: 2
"""

HTTP_ROUTE = "http.route"
"""
The matched route, that is, the path template used to match the request.
Expand Down Expand Up @@ -952,12 +982,24 @@ class SPANDATA:
Example: "com.example.ExampleService/exampleMethod"
"""

RPC_SERVICE = "rpc.service"
"""
The full (logical) name of the service being called, including its package name, if applicable.
Example: "myService.BestService"
"""

RPC_RESPONSE_STATUS_CODE = "rpc.response.status_code"
"""
Status code of the RPC returned by the RPC server or generated by the client.
Example: "DEADLINE_EXCEEDED"
"""

RPC_SYSTEM_NAME = "rpc.system.name"
"""
A string identifying the remoting system.
Example: "aws-api"
"""

SERVER_ADDRESS = "server.address"
"""
Name of the database host.
Expand Down Expand Up @@ -1147,6 +1189,18 @@ class SPANDATA:
Used in inbound filters.
"""

SENTRY_OP = "sentry.op"
"""
The operation of a span.
Example: "http.client"
"""

SENTRY_ORIGIN = "sentry.origin"
"""
The origin of the instrumentation (e.g. span, log, etc.)
Example: "auto.http.otel.fastify"
"""

SENTRY_RELEASE = "sentry.release"
"""
The Sentry release.
Expand Down Expand Up @@ -1177,6 +1231,13 @@ class SPANDATA:
Example: ["AtexitIntegration", "StdlibIntegration"]
"""

USER_AGENT_ORIGINAL = "user_agent.original"
"""
Value of the HTTP User-Agent header sent by the client.
Used in inbound filters.
"""


class OP:
ANTHROPIC_MESSAGES_CREATE = "ai.messages.create.anthropic"
Expand Down
4 changes: 4 additions & 0 deletions sentry_sdk/integrations/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ async def sentry_app_handle(
),
)

user_agent = request.headers.get("User-Agent")
if user_agent:
scope.set_attribute(SPANDATA.USER_AGENT_ORIGINAL, user_agent)

headers = dict(request.headers)

sentry_sdk.continue_trace(headers)
Expand Down
221 changes: 0 additions & 221 deletions sentry_sdk/integrations/boto3.py

This file was deleted.

21 changes: 21 additions & 0 deletions sentry_sdk/integrations/boto3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.integrations.boto3._client import _patch_botocore_client
from sentry_sdk.integrations.boto3.consts import IDENTIFIER, ORIGIN
from sentry_sdk.utils import parse_version

try:
from botocore import __version__ as BOTOCORE_VERSION
except ImportError:
raise DidNotEnable("botocore is not installed")


class Boto3Integration(Integration):
identifier = IDENTIFIER
origin = ORIGIN

@staticmethod
def setup_once() -> None:
version = parse_version(BOTOCORE_VERSION)
_check_minimum_version(Boto3Integration, version, "botocore")

_patch_botocore_client()
Loading
Loading