Skip to content

fix(telemetry): use the stable pgflow collector endpoint - #692

Merged
jumski merged 2 commits into
mainfrom
691-fix-telemetry
Oct 2, 2026
Merged

jumski merged 2 commits into
mainfrom
691-fix-telemetry

Conversation

@jumski

@jumski jumski commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix both telemetry senders to use https://telemetry.pgflow.dev, replacing the non-resolving hostname shipped in 0.17.1.
  • Add a generated, function-only upgrade migration. Preserve the released migration, opt-out state, timeout/failure behavior, and privacy safeguards.
  • Update regression tests and upgrade guidance; add patch changesets for @pgflow/core and pgflow within 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

  • Migration verification, generated database types, Atlas checksum validation, and fresh-install materialization pass. A separate local 0.17.1 upgrade check passes for enabled and opted-out databases.
  • Full pgTAP: 318 files / 1,674 assertions pass, plus existing upgrade fixtures. Edge-worker integration: 65; E2E: 13; portable-runtime E2E: 14; Bun smoke passes.
  • CLI unit: 30; collector unit: 27 plus typecheck; CLI install/idempotence E2E and client E2E (47 tests) pass.
  • Affected lint/typecheck/tests, builds/exports, final website build and internal links, and staged Changesets validation pass subject to the environment qualification below. Normal commit and pre-push hooks pass; the committed tree matches the independently reviewed candidate.
  • Independent review approved all nine changed paths with no blockers. Hosted PR CI at 9b106a9f6: 15 checks pass, one skips, none fail. Windows package smoke passed on the user-authorized rerun without code changes; gh pr checks --watch completed successfully.

Resolved CI infrastructure failure

Windows package smoke failed while downloading the Supabase CLI Windows archive, before any package smoke test ran:

FetchError: request to https://github.com/supabase/cli/releases/download/v2.63.1/supabase_windows_amd64.tar.gz failed, reason: connect ETIMEDOUT 172.182.252.133:443

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:test with 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.

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-bot

changeset-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a99d146

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@pgflow/core Patch
pgflow Patch
@pgflow/client Patch
@pgflow/edge-worker Patch
@pgflow/dsl Patch

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

@nx-cloud

nx-cloud Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit a99d146

Command Status Duration Result
nx run cli:e2e ✅ Succeeded 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-02 05:55:16 UTC

@jumski jumski left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments.

Comment on lines +118 to +127
## 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview Deployment: Website

✅ Deployment successful!

🔗 Preview URL: https://pr-692.pgflow.pages.dev

📝 Details:

  • Branch: 691-fix-telemetry
  • Commit: e629d1cf0359b5bc0998892af62732f8dbb54339
  • View Logs

_Last updated: _

@jumski
jumski merged commit fb5b867 into main Oct 2, 2026
27 of 28 checks passed
@jumski
jumski deleted the 691-fix-telemetry branch October 2, 2026 06:13
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Production Deployment: Website

✅ Successfully deployed to production!

🔗 Production URL: https://pgflow.dev

📝 Details:

  • Commit: fb5b8670e52e7f577eb78169de29122d22b4d164
  • View Logs

Deployed at: 2026-10-02T08:13:21+02:00

jumski added a commit that referenced this pull request Oct 2, 2026
#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.

This branch was successfully deployed

1 active deployment
preview — a99d1461 Deployed Oct 2, 2026 by jumski via deploy-website #3414
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.

Fix telemetry endpoint, deploy collector on telemetry.pgflow.dev, and release patch

1 participant