fix(telemetry): use the stable pgflow collector endpoint - #692
Conversation
The 0.17.1 CLI and database senders use a workers.dev hostname without the account subdomain, so telemetry cannot reach the collector. Point both senders at telemetry.pgflow.dev while preserving failure handling and privacy safeguards. Add a generated function-only upgrade migration without rewriting released history or enabling telemetry for opted-out databases. Update regression checks, upgrade guidance, and patch changesets. Collector deployment and release remain separate prerequisites tracked in #691.
🦋 Changeset detectedLatest commit: a99d146 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
View your CI Pipeline Execution ↗ for commit a99d146
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
jumski
left a comment
There was a problem hiding this comment.
See inline comments.
| ## Upgrading from 0.17.1 | ||
|
|
||
| pgflow 0.17.1 pointed both senders at `https://pgflow-telemetry.workers.dev`, a hostname that does not resolve. The corrected endpoint is `https://telemetry.pgflow.dev`. | ||
|
|
||
| - Databases get the corrected daily sender through a new pgflow migration that replaces `pgflow_telemetry.report()`. Update pgflow, rerun `pgflow install` to copy the migration, and apply it with your normal Supabase migration workflow. Databases that disabled telemetry stay disabled: the migration replaces only the function and never reschedules the reporting job. | ||
| - The corrected installation sender ships in the pgflow CLI patch release; update the CLI you invoke (`npx pgflow@latest`). | ||
| - Deploying the collector endpoint alone does not repair 0.17.1: its senders keep using the unresolvable hostname until you upgrade. | ||
|
|
||
| Until the upgrade lands, daily reports from 0.17.1 databases fail silently, exactly like any other send failure: no error surfaces in your database, and the day is not retried. | ||
|
|
There was a problem hiding this comment.
this is not needed at all
Review feedback: the sentence restated existing failure behavior and added no upgrade guidance. The upgrade bullets already cover the migration, CLI update, and endpoint prerequisite.
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-692.pgflow.pages.dev 📝 Details:
_Last updated: _ |
🚀 Production Deployment: Website✅ Successfully deployed to production! 🔗 Production URL: https://pgflow.dev 📝 Details:
Deployed at: 2026-10-02T08:13:21+02:00 |
#695) ## Summary - Redirect browser GET requests to `https://pgflow.dev/reference/telemetry/` with HTTP 302; leave POST telemetry ingestion unchanged. - Keep other HTTP methods at 405 and check that redirects/rejections do not write Analytics Engine points. - Declare `telemetry.pgflow.dev` as the collector's Worker Custom Domain so Wrangler manages DNS and TLS at deployment. ## Checks - `pnpm nx test-env:fresh edge-worker` passed. - `pnpm nx run @pgflow/telemetry-worker:test` passed: 32 tests. - Nx reports only `@pgflow/telemetry-worker` affected. - `pnpm nx affected -t test typecheck lint --base=HEAD` passed before commit. - `pnpm --dir apps/telemetry-worker exec wrangler deploy --dry-run` passed with the existing `PGFLOW_TELEMETRY` Analytics Engine binding. - `git diff --check` passed; the committed tree matches the checked files. ## Deployment This PR does not deploy Cloudflare infrastructure. After merge, run the collector deployment from main with a token authorized for the Worker and Custom Domain. Keep request logging disabled. GET redirects to the docs; a valid JSON POST returns 204. A production smoke-test POST writes a real Analytics Engine point. No npm/JSR release or changeset is needed: the collector is private and 0.17.2 senders already use this hostname. Related: #691/#692 corrected the sender endpoint; this PR declares the hosting route and browser behavior.
Summary
https://telemetry.pgflow.dev, replacing the non-resolving hostname shipped in 0.17.1.@pgflow/coreandpgflowwithin the existing fixed version group.Closes #691
Deployment and release gates remain open
This PR delivers the code portion of #691, not its full operational acceptance. No Cloudflare/DNS changes, collector deployment, production ingestion, merge, package publication, or registry verification occurred in this delivery. Complete and record those issue requirements separately; the issue-closing link is not evidence of completion.
Make the custom-domain endpoint live before publishing corrected senders. Existing 0.17.1 databases need the new migration, and CLI installations need the corrected version. No audit replay/backfill or recovery of lost telemetry is included.
Checks
9b106a9f6: 15 checks pass, one skips, none fail. Windows package smoke passed on the user-authorized rerun without code changes;gh pr checks --watchcompleted successfully.Resolved CI infrastructure failure
Windows package smoke failed while downloading the Supabase CLI Windows archive, before any package smoke test ran:
The user explicitly authorized a rerun of the failed job. Attempt 2 passed in 1m36s at the unchanged head. No code repair was needed; the CI gate is clear.
Local evidence qualifications
The broad quality run initially failed only at
demo:testwith a host-provided Groq key: the upstream API reported model unavailability or missing access. The focused reproduction returned the same error; the keyless CI-equivalent run passes. This PR does not change that dependency or establish that the model is retired. Pre-push hooks also ran in the keyless environment.The initial Changesets status check could not see the untracked changeset; the staged review and normal pre-push Changesets checks now pass. The upgrade check log records successful enabled/opted-out checks, but does not retain its runnable script.