Fix pg.instanode.dev monitor: use Upptime tcp-ping schema#4
Merged
Conversation
The previous config probed `https://pg.instanode.dev:5432` with `method: TCP_PING` + `tcpHostPort`. Neither of those keys exists in the Upptime config schema (`UpptimeConfig.sites[]` in upptime/uptime-monitor `src/interfaces.ts`), so the action ignored them and fell through to curl, which tried a TLS handshake against the raw Postgres wire-protocol port and logged: Curl attempt 1/3 returned HTTP 0: Request failed: SSL connect error Error does not appear transient, skipping further retries The endpoint itself is healthy. Port 5432 on the public LoadBalancer IP (152.42.154.144) is exposed by `ingress-nginx` via the `tcp-services` ConfigMap, routed to the `instant-pg-proxy` Service in the `instant` namespace, which fronts customer Postgres pools. `nc -zv pg.instanode.dev 5432` succeeds, and `pg-proxy` logs show both replicas listening. Switch to Upptime's documented raw-TCP probe shape: check: "tcp-ping" url: pg.instanode.dev port: 5432 No HTTPS scheme, no synthetic `expectedStatusCodes` fallback list, no `tcpHostPort` (which Upptime doesn't read). The next Uptime CI run should record an "up" status for this site. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Uptime CIhas been recordingpg.instanode.dev:5432as down with a permanent SSL error since the 7-service-bundle expansion. The endpoint is not broken — the monitor config is. This PR rewrites that one entry to match Upptime's documented raw-TCP probe schema.Root cause
.upptimerc.ymlhad:Neither
method: TCP_PINGnortcpHostPortexists in Upptime's UpptimeConfig.sites schema. They were silently ignored, leaving Upptime to do its default action:curl https://pg.instanode.dev:5432. Curl opens a TCP connection, tries a TLS handshake against the raw Postgres wire-protocol port (which speaksStartupMessage/SSLRequest, not TLS-from-byte-zero), and gets back zero bytes — hence the log line inSetup CI:Investigation evidence
The endpoint itself is healthy:
nc -zv pg.instanode.dev 5432→succeededdig pg.instanode.dev→152.42.154.144(the cluster LoadBalancer)kubectl get svc -n ingress-nginx ingress-nginx-controllershows port5432:30213/TCPis exposed by the LoadBalancerkubectl get cm -n ingress-nginx tcp-services -o yamlroutes port5432toinstant/instant-pg-proxy:5432kubectl logs -n instant deploy/instant-pg-proxyshows both replicas listening with the configured route prefix and fallback backendkubectl get svc -A | grep postgresconfirms the service exists ininstant-data(postgres-customers) and the proxy ininstant(instant-pg-proxy)So: the port is open, the proxy is running, customer Postgres provisioning works. Only the monitor was lying.
The fix
Switch to Upptime's official raw-TCP probe shape:
check: "tcp-ping"is the supported value inUpptimeConfig.sites[].checkand is handled by a dedicated TCP-ping branch inupdate.ts(lines 350-426) that bypasses curl entirely. Theurlbecomes a bare hostname, the port goes in its own field, and there is no syntheticexpectedStatusCodesfallback — the check passes when the TCP connect succeeds.Test plan
master— Setup CI runs on push and seeds the new site entry.Uptime CImanually from the Actions tab (or wait 5 min for the next cron run).history/customer-postgres-pginstanodedev-tcp.ymlrecordsstatus: upwith a saneresponseTime(single-digit ms).instant-pg-proxyto 0 in a test cluster and confirm the monitor flips todownwith aconnect failed-style error — proving the probe is actually exercising the right code path.🤖 Generated with Claude Code