fix(links): report Kafka probe failures as degraded, not unavailable
TY
1d ago+319+319+012345678901234567890123456789-22-22-01234567890123456789
Summary
Addresses maintainer feedback on #721 (supersedes the closed PR).
- Keeps
calculateLinkReadinessas the single HTTP status policy: Kafka down with ClickHouse up stays HTTP 200 degraded. - Maps Redpanda to
errorwhen the health probe leaves the producer inidlebutdidKafkaConnectFail()is true (fixes falseokreadiness). - No blanket 503 short-circuit on Kafka connect failure.
Linked issue
Fixes #719
Test plan
-
bun test apps/links/src/lib/health.test.ts(6 pass)
AI disclosure
AI-assisted implementation; human-reviewed against izadoesdev review on #721.
Summary by cubic
Fixes the links service health check so Kafka failures report degraded instead of unavailable, and no longer reports false ok readiness after a connect failure.
- Kafka down with ClickHouse up now returns HTTP 200 degraded via
calculateLinkReadiness, replacing the previous 503 short-circuit. - A failed Kafka connect now maps Redpanda to
erroreven when the producer state isidle, fixing the falseok. refreshProducerConnectionrejects loudly on failure and records akafka_health_connect_failedattribute.sendLinkVisitkeeps falling back to ClickHouse when Kafka is unreachable, anddisconnectProducerno longer fails if a pending connection dies during shutdown.- Redpanda SSL is now disabled when
REDPANDA_SSLorREDPANDA_SSL_ENABLEDis set tofalse(previously always on).