fix(api): report which health probe failed and keep error names in logs#192

open1
main
polylane/autofix/qp5bqfxvivdl
opened27d agobyPpolylaneBot
View on GitHubTwo-way sync enabledPR last imported 20d ago

Generated by Polylane Autofix from a fix run.

A failing health probe returns an empty negative answer, so a deploy that stops at the gate or an uptime alert leaves nobody able to say which dependency broke. This change records that reason, and gives the same treatment to two failures the service swallows: a subscription that cannot reconcile, and a stalled batch of delivery emails.

mermaid
1flowchart LR
2 A["deploy gate or uptime probe"] --> B["GET /health"]
3 B --> C{"database probe"}
4 C -->|fails| D["event: health probe failed<br/>probe=database, error=tag"]
5 C -->|ok| E{"storage probe"}
6 E -->|fails| F["event: health probe failed<br/>probe=storage, error=tag"]
7 E -->|ok| G["200 ok true"]
8 D --> H["503 ok false"]
9 F --> H

Why this fix

The health route is the deploy gate and the uptime probe, and it was the one place a 503 carried no reason at all: the probe now names the dependency and the error's tag on the request span, so a database outage is told from a storage one without a redeploy to find out. A subscription that fails to reconcile logs which account and the error's name, which separates one broken row from a vendor-wide failure after a lost webhook. A delivery-email batch that stops settling logs the error's name, so a code defect is told from an infrastructure fault. Every field is an id, a tag or a count, never a payload, an address or SQL.

View thread View autofix


Generated by Polylane. You can ask follow-ups by mentioning @polylane in a comment.

Checks

4 successful · 1 skipped · 1 neutral
All checks passed
c2f77f8

Added 1 commit

  • fix(api): report the failing health probe and keep error names in swallowed logsc2f77f8
Synced from GitHub

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2080b5ad-ea40-4a70-b17d-5a6d1b7d4422

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.