✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.52
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/redis/modules//queries.py
"""
Code used for the Queries module in Sentry
"""

from typing import TYPE_CHECKING

from sentry_sdk.consts import OP, SPANDATA
from sentry_sdk.integrations.redis.utils import _get_safe_command
from sentry_sdk.traces import StreamedSpan
from sentry_sdk.utils import capture_internal_exceptions

if TYPE_CHECKING:
    from typing import Any, Union

    from redis import Redis

    from sentry_sdk.integrations.redis import RedisIntegration
    from sentry_sdk.tracing import Span


def _compile_db_span_properties(
    integration: "RedisIntegration", redis_command: str, args: "tuple[Any, ...]"
) -> "dict[str, Any]":
    description = _get_db_span_description(integration, redis_command, args)

    properties = {
        "op": OP.DB_REDIS,
        "description": description,
    }

    return properties


def _get_db_span_description(
    integration: "RedisIntegration", command_name: str, args: "tuple[Any, ...]"
) -> str:
    description = command_name

    with capture_internal_exceptions():
        description = _get_safe_command(command_name, args)

    if integration.max_data_size and len(description) > integration.max_data_size:
        description = description[: integration.max_data_size - len("...")] + "..."

    return description


def _set_db_data_on_span(
    span: "Union[Span, StreamedSpan]", connection_params: "dict[str, Any]"
) -> None:
    db = connection_params.get("db")
    host = connection_params.get("host")
    port = connection_params.get("port")

    if isinstance(span, StreamedSpan):
        span.set_attribute(SPANDATA.DB_SYSTEM_NAME, "redis")
        span.set_attribute(SPANDATA.DB_DRIVER_NAME, "redis-py")

        if db is not None:
            span.set_attribute(SPANDATA.DB_NAMESPACE, str(db))

        if host is not None:
            span.set_attribute(SPANDATA.SERVER_ADDRESS, host)

        if port is not None:
            span.set_attribute(SPANDATA.SERVER_PORT, port)

    else:
        span.set_data(SPANDATA.DB_SYSTEM, "redis")
        span.set_data(SPANDATA.DB_DRIVER_NAME, "redis-py")

        if db is not None:
            span.set_data(SPANDATA.DB_NAME, str(db))

        if host is not None:
            span.set_data(SPANDATA.SERVER_ADDRESS, host)

        if port is not None:
            span.set_data(SPANDATA.SERVER_PORT, port)


def _set_db_data(
    span: "Union[Span, StreamedSpan]", redis_instance: "Redis[Any]"
) -> None:
    try:
        _set_db_data_on_span(span, redis_instance.connection_pool.connection_kwargs)
    except AttributeError:
        pass  # connections_kwargs may be missing in some cases


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Jun 2026 5.00 AM
root / root
0755
__pycache__
--
11 Jun 2026 5.00 AM
root / root
0755
__init__.py
0 KB
11 Jun 2026 5.00 AM
root / root
0644
caches.py
4.106 KB
11 Jun 2026 5.00 AM
root / root
0644
queries.py
2.521 KB
11 Jun 2026 5.00 AM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF