Skip to content

Commit c816613

Browse files
authored
Reapply "ref(ingest): Remove celery healthchecks entirely #99667" (#99787)
- **Reapply "ref(ingest): Remove celery healthchecks entirely (#99667)"** - **skip unknown services**
1 parent c9f8c5d commit c816613

File tree

5 files changed

+5
-49
lines changed

5 files changed

+5
-49
lines changed

src/sentry/conf/server.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3918,19 +3918,15 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
39183918
SENTRY_SERVICE_MONITORING_REDIS_CLUSTER = "default"
39193919

39203920
# This is a view of which abstract processing service is backed by which infrastructure.
3921-
# Right now, the infrastructure can be `redis` or `rabbitmq`.
3921+
# Right now, the infrastructure can be `redis`.
39223922
#
39233923
# For `redis`, one has to provide the cluster id.
39243924
# It has to match a cluster defined in `redis.redis_clusters`.
39253925
#
3926-
# For `rabbitmq`, one has to provide a list of server URLs.
3927-
# The URL is in the format `http://{user}:{password}@{hostname}:{port}/`.
3928-
#
39293926
# The definition can also be empty, in which case nothing is checked and
39303927
# the service is assumed to be healthy.
39313928
# However, the service *must* be defined.
39323929
SENTRY_PROCESSING_SERVICES: Mapping[str, Any] = {
3933-
"celery": {"redis": "default"},
39343930
"attachments-store": {"redis": "default"},
39353931
"processing-store": {}, # "redis": "processing"},
39363932
"processing-store-transactions": {},

src/sentry/options/defaults.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,11 +2199,6 @@
21992199

22002200
# The high-watermark levels per-service which will mark a service as unhealthy.
22012201
# This should mirror the `SENTRY_PROCESSING_SERVICES` setting.
2202-
register(
2203-
"backpressure.high_watermarks.celery",
2204-
default=0.5,
2205-
flags=FLAG_AUTOMATOR_MODIFIABLE,
2206-
)
22072202
register(
22082203
"backpressure.high_watermarks.attachments-store",
22092204
default=0.8,

src/sentry/processing/backpressure/memory.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import Any, Union
44

55
import rb
6-
import requests
76
from redis import StrictRedis
87
from rediscluster import RedisCluster
98

@@ -30,21 +29,6 @@ class NodeInfo:
3029
port: int | None
3130

3231

33-
def query_rabbitmq_memory_usage(host: str) -> ServiceMemory:
34-
"""Returns the currently used memory and the memory limit of a
35-
RabbitMQ host.
36-
"""
37-
38-
if not host.endswith("/"):
39-
host += "/"
40-
url = f"{host}api/nodes"
41-
42-
response = requests.get(url, timeout=3)
43-
response.raise_for_status()
44-
json = response.json()
45-
return ServiceMemory(host, json[0]["mem_used"], json[0]["mem_limit"])
46-
47-
4832
# Based on configuration, this could be:
4933
# - a `rediscluster` Cluster (actually `RetryingRedisCluster`)
5034
# - a `rb.Cluster` (client side routing cluster client)

src/sentry/processing/backpressure/monitor.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
from sentry.processing.backpressure.health import UnhealthyReasons, record_consumer_health
1212

1313
# from sentry import options
14-
from sentry.processing.backpressure.memory import (
15-
Cluster,
16-
ServiceMemory,
17-
iter_cluster_memory_usage,
18-
query_rabbitmq_memory_usage,
19-
)
14+
from sentry.processing.backpressure.memory import Cluster, ServiceMemory, iter_cluster_memory_usage
2015
from sentry.processing.backpressure.topology import ProcessingServices
2116
from sentry.utils import redis
2217

@@ -28,12 +23,7 @@ class Redis:
2823
cluster: Cluster
2924

3025

31-
@dataclass
32-
class RabbitMq:
33-
servers: list[str]
34-
35-
36-
Service = Union[Redis, RabbitMq, None]
26+
Service = Union[Redis, None]
3727

3828

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

48-
elif isinstance(service, RabbitMq):
49-
for server in service.servers:
50-
yield query_rabbitmq_memory_usage(server)
51-
5238

5339
def load_service_definitions() -> dict[str, Service]:
5440
services: dict[str, Service] = {}
@@ -59,12 +45,8 @@ def load_service_definitions() -> dict[str, Service]:
5945
config={"cluster": cluster_id},
6046
)
6147
services[name] = Redis(cluster)
62-
63-
elif rabbitmq_urls := definition.get("rabbitmq"):
64-
services[name] = RabbitMq(rabbitmq_urls)
65-
6648
else:
67-
services[name] = None
49+
logger.error("Unknown service: %s", name)
6850

6951
return services
7052

src/sentry/processing/backpressure/topology.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class ProcessingServices(Enum):
11-
Celery = "celery"
1211
AttachmentsStore = "attachments-store"
1312
ProcessingStore = "processing-store"
1413
ProcessingStoreTransactions = "processing-store-transactions"
@@ -17,7 +16,7 @@ class ProcessingServices(Enum):
1716

1817

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

2221

2322
CONSUMERS = {

0 commit comments

Comments
 (0)