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
6 changes: 1 addition & 5 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3918,19 +3918,15 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
SENTRY_SERVICE_MONITORING_REDIS_CLUSTER = "default"

# This is a view of which abstract processing service is backed by which infrastructure.
# Right now, the infrastructure can be `redis` or `rabbitmq`.
# Right now, the infrastructure can be `redis`.
#
# For `redis`, one has to provide the cluster id.
# It has to match a cluster defined in `redis.redis_clusters`.
#
# For `rabbitmq`, one has to provide a list of server URLs.
# The URL is in the format `http://{user}:{password}@{hostname}:{port}/`.
#
# The definition can also be empty, in which case nothing is checked and
# the service is assumed to be healthy.
# However, the service *must* be defined.
SENTRY_PROCESSING_SERVICES: Mapping[str, Any] = {
"celery": {"redis": "default"},
"attachments-store": {"redis": "default"},
"processing-store": {}, # "redis": "processing"},
"processing-store-transactions": {},
Expand Down
5 changes: 0 additions & 5 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2199,11 +2199,6 @@

# The high-watermark levels per-service which will mark a service as unhealthy.
# This should mirror the `SENTRY_PROCESSING_SERVICES` setting.
register(
"backpressure.high_watermarks.celery",
default=0.5,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
register(
"backpressure.high_watermarks.attachments-store",
default=0.8,
Expand Down
16 changes: 0 additions & 16 deletions src/sentry/processing/backpressure/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Any, Union

import rb
import requests
from redis import StrictRedis
from rediscluster import RedisCluster

Expand All @@ -30,21 +29,6 @@ class NodeInfo:
port: int | None


def query_rabbitmq_memory_usage(host: str) -> ServiceMemory:
"""Returns the currently used memory and the memory limit of a
RabbitMQ host.
"""

if not host.endswith("/"):
host += "/"
url = f"{host}api/nodes"

response = requests.get(url, timeout=3)
response.raise_for_status()
json = response.json()
return ServiceMemory(host, json[0]["mem_used"], json[0]["mem_limit"])


# Based on configuration, this could be:
# - a `rediscluster` Cluster (actually `RetryingRedisCluster`)
# - a `rb.Cluster` (client side routing cluster client)
Expand Down
22 changes: 2 additions & 20 deletions src/sentry/processing/backpressure/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
from sentry.processing.backpressure.health import UnhealthyReasons, record_consumer_health

# from sentry import options
from sentry.processing.backpressure.memory import (
Cluster,
ServiceMemory,
iter_cluster_memory_usage,
query_rabbitmq_memory_usage,
)
from sentry.processing.backpressure.memory import Cluster, ServiceMemory, iter_cluster_memory_usage
from sentry.processing.backpressure.topology import ProcessingServices
from sentry.utils import redis

Expand All @@ -28,12 +23,7 @@ class Redis:
cluster: Cluster


@dataclass
class RabbitMq:
servers: list[str]


Service = Union[Redis, RabbitMq, None]
Service = Union[Redis, None]


def check_service_memory(service: Service) -> Generator[ServiceMemory]:
Expand All @@ -45,10 +35,6 @@ def check_service_memory(service: Service) -> Generator[ServiceMemory]:
if isinstance(service, Redis):
yield from iter_cluster_memory_usage(service.cluster)

elif isinstance(service, RabbitMq):
for server in service.servers:
yield query_rabbitmq_memory_usage(server)


def load_service_definitions() -> dict[str, Service]:
services: dict[str, Service] = {}
Expand All @@ -59,10 +45,6 @@ def load_service_definitions() -> dict[str, Service]:
config={"cluster": cluster_id},
)
services[name] = Redis(cluster)

elif rabbitmq_urls := definition.get("rabbitmq"):
services[name] = RabbitMq(rabbitmq_urls)

else:
services[name] = None

Expand Down
3 changes: 1 addition & 2 deletions src/sentry/processing/backpressure/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class ProcessingServices(Enum):
Celery = "celery"
AttachmentsStore = "attachments-store"
ProcessingStore = "processing-store"
ProcessingStoreTransactions = "processing-store-transactions"
Expand All @@ -17,7 +16,7 @@ class ProcessingServices(Enum):


def get_all_services() -> list[str]:
return [item.value for item in ProcessingServices if item != ProcessingServices.Celery]
return [item.value for item in ProcessingServices]


CONSUMERS = {
Expand Down
Loading