Skip to content

fix: harden tracker and uptime delivery - #585

Merged
izadoesdev merged 4 commits into
stagingfrom
codex/reliability-relay-extraction
Aug 2, 2026
Merged

fix: harden tracker and uptime delivery#585
izadoesdev merged 4 commits into
stagingfrom
codex/reliability-relay-extraction

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

  • bound tracker pixel retries, image loads, and cancellation; pixel unloads retain the normal fallback path
  • make uptime delivery durable: checkpoint completed probes on the source job, relay them through BullMQ, and require acknowledged Kafka sends
  • keep the relay event ID inside the worker and delivery queue; strip it before Kafka/Vector so the existing ClickHouse schema remains unchanged
  • refresh existing schedulers with the durable job options and harden uptime worker shutdown

Scope

Clean replacement for #581 on current staging. It intentionally excludes that branch's stale Basket and Vector changes.

Verification

  • bun run lint
  • bun run check-types
  • focused tracker, uptime, Redis, AI query, database schema, and RPC tests

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboard Ready Ready Preview Aug 2, 2026 2:10pm
databuddy-status Ready Ready Preview Aug 2, 2026 2:10pm
documentation Ready Ready Preview Aug 2, 2026 2:10pm

@unkey-deploy

unkey-deploy Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Aug 2, 2026 2:09pm

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 274a03a7-8e10-4301-9874-71913b0aa65c

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

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.

@dosubot

dosubot Bot commented Aug 2, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about Databuddy Add Dosu to your team

@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes uptime event delivery durable through a checkpointed BullMQ relay and acknowledged Kafka sends, refreshes scheduler retry options, adds replay-aware reporting queries, and bounds tracker pixel retries and cancellation.

  • Adds per-probe event IDs, persisted source-job checkpoints, and a dedicated uptime delivery worker.
  • Reconciles existing schedulers with durable retry settings and performs ordered worker shutdown.
  • Deduplicates replayed ClickHouse rows in uptime and status-page reporting.
  • Bounds pixel image loads and retry delays while retaining the normal unload fallback.

Confidence Score: 4/5

The reporting deduplication should be corrected before merging because it can discard distinct uptime checks that happen to have identical stored values.

The new event ID provides a unique probe identity only until ingestion, where it is dropped; downstream queries consequently deduplicate by mutable observation values and cannot distinguish an exact replay from two genuinely separate identical probes.

Files Needing Attention: packages/ai/src/query/builders/uptime.ts and packages/rpc/src/routers/status-page.ts

Important Files Changed

Filename Overview
apps/uptime/src/worker.ts Adds checkpoint replay, a dedicated delivery worker, payload validation, and ordered durable handoff.
packages/redis/uptime-queue.ts Defines the delivery queue, deterministic event job IDs, and long-lived fixed retry options.
apps/uptime/src/lib/producer.ts Reworks Kafka producer lifecycle to share connections, require acknowledgements, and surface send failures.
packages/ai/src/query/builders/uptime.ts Adds full-row replay deduplication that can also collapse distinct probes whose stored values coincide.
packages/rpc/src/routers/status-page.ts Applies the same value-based replay deduplication to public status calculations.
packages/tracker/src/plugins/pixel.ts Bounds image loads and retries, integrates cancellation, and preserves fallback behavior on unload.
apps/uptime/src/index.ts Starts both workers and drains them in source-before-delivery order with fatal exit-code preservation.

Sequence Diagram

sequenceDiagram
  participant S as BullMQ source job
  participant P as Uptime probe
  participant D as BullMQ delivery queue
  participant K as Kafka
  participant V as Vector
  participant C as ClickHouse
  S->>P: Run probe
  P-->>S: UptimeData with event_id
  S->>S: Checkpoint event in job data
  S->>D: Add deterministic delivery job
  D->>K: Send with all-replica acknowledgement
  K->>V: analytics-uptime-checks
  V->>C: Insert known uptime columns
  Note over V,C: event_id is dropped
  C-->>C: Reporting applies value-based LIMIT 1 BY
Loading

Reviews (1): Last reviewed commit: "fix(uptime): durably relay completed che..." | Re-trigger Greptile

Comment thread packages/ai/src/query/builders/uptime.ts Outdated
@izadoesdev
izadoesdev deleted the codex/reliability-relay-extraction branch August 2, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant