Skip to content

chore(migrate): align scaffold + skill with 5.0 CF-native observability - #160

Merged
vibe-dex merged 1 commit into
mainfrom
chore/migration-scaffold-cf-native
May 8, 2026
Merged

chore(migrate): align scaffold + skill with 5.0 CF-native observability#160
vibe-dex merged 1 commit into
mainfrom
chore/migration-scaffold-cf-native

Conversation

@vibe-dex

@vibe-dex vibe-dex commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rewrites the observability comments in scripts/migrate/templates/server-entry.ts (both the non-VTEX and VTEX worker-entry templates) so they describe the 5.0+ Cloudflare-native stack instead of the pre-5.0 OTLP-push stack.
  • Rewrites scripts/migrate/phase-report.ts step 7 to drop the HyperDX provisioning line and point at the canonical CF-native block + the future ClickHouse path.
  • Adds a new section 47 in the migration skill's references/worker-cloudflare.md covering instrumentWorker's 5.0 surface, the required wrangler.jsonc shape (including the enabled: true master switch), AE auto-provisioning, and the ClickHouse-collector stub.

Why

The framework PR (#156) and the codemod (#150-area) updated the runtime + the wrangler codemod, but the scaffold-time documentation that the migration script bakes into a new site's worker-entry comment header and MIGRATION_REPORT.md was still describing the pre-5.0 behaviour. The next person to run deco-migrate would get a worker-entry whose comments contradict the framework version they're consuming.

This is the scaffold-update todo from the drop-hyperdx-cf-rollout plan — wrapping up Phase 3.3.

What changes

scripts/migrate/templates/server-entry.ts

Both generateWorkerEntry (non-VTEX, default scaffold) and generateVtexWorkerEntry (VTEX scaffold) get their observability comment header rewritten to describe:

  • logs: console.* -> CF Workers Logs (no app-side exporter)
  • traces: @opentelemetry/api global tracer (bridged from withTracing) -> CF Workers Tracing
  • metrics: AE only (the OTLP metrics path is gone in 5.0)
  • the ClickHouse collector adapter as the documented future direction

scripts/migrate/phase-report.ts

Step 7 in the generated MIGRATION_REPORT.md next-steps was:

Pushes console.* logs and OTel traces to HyperDX via Cloudflare-managed OTLP export. Requires the hyperdx-logs and hyperdx-traces destinations to be provisioned at the CF account level.

Replaced with a paragraph that points at the canonical CF dashboard view, notes that no external destination is needed today, and previews the future --destination-logs / --destination-traces opt-in flag once ClickHouse-via-collector ships.

.agents/skills/deco-to-tanstack-migration/references/worker-cloudflare.md

New section 47 ("Observability (5.0+, Cloudflare-native)") covers:

  • what instrumentWorker does in 5.0+ and what options it no longer accepts
  • the canonical wrangler.jsonc shape with the observability.enabled: true master switch (the master switch I learned about the hard way during the lebiscuit canary)
  • AE auto-provisioning on first writeDataPoint
  • the ClickHouse-collector stub at src/sdk/otelAdapters/clickhouseCollector.ts as the future direction

Test plan

  • bunx tsc --noEmit passes
  • No linter errors on the touched files
  • Visual review on the rendered Markdown (skill reference) and the inline JSDoc in the generated worker-entry template

Made with Cursor


Summary by cubic

Aligns the migration scaffold and docs with the 5.0 Cloudflare‑native observability stack. Removes OTLP/HyperDX guidance, points to the CF dashboard, and documents the required wrangler.jsonc shape and future ClickHouse path.

  • Refactors
    • Rewrites observability header comments in scripts/migrate/templates/server-entry.ts (default and VTEX) for 5.0: logs via CF Workers Logs, traces via @opentelemetry/api → CF Tracing, metrics via AE.
    • Updates scripts/migrate/phase-report.ts step 7 to add the canonical observability block guidance, remove HyperDX provisioning, and preview future --destination-logs/--destination-traces flags.
    • Adds section 47 to references/worker-cloudflare.md covering instrumentWorker in 5.0, the required wrangler.jsonc (observability.enabled: true, DECO_METRICS), AE auto-provisioning, removed options (enableAppSideOtlpLogs, otlp*, samplingConfig, exportIntervalMillis), and the ClickHouse collector stub (sdk/otelAdapters/clickhouseCollector).

Written for commit cdab162. Summary will update on new commits.

The migration scaffold's server-entry template and phase-report
next-steps were still describing the pre-5.0 observability stack:
"CF-managed OTLP push when wrangler.jsonc has
observability.logs.destinations", and the report's bullet 7 was
literally pointing at HyperDX provisioning.

5.0 dropped the in-Worker OTLP transport. The CF dashboard is the
destination — no destinations, no flush hook, no OTLP exporter. This
PR brings the scaffold-time documentation in line with what the
framework actually does and adds a new section 47 in the migration
skill (worker-cloudflare reference) covering:

- what instrumentWorker still does in 5.0+ (api-bridge, attribute
  floor, AE binding wiring) and what it no longer accepts
  (enableAppSideOtlpLogs, otlpEndpoint, otlpHeaders, otlpMinSeverity,
  samplingConfig, exportIntervalMillis)
- the canonical wrangler.jsonc shape with the master switch
  observability.enabled at the top level (a master switch I learned
  about the hard way during the lebiscuit canary)
- AE datasets are auto-provisioned on first writeDataPoint — no CF
  API call, no dashboard step
- the ClickHouse-collector adapter scaffolded at
  src/sdk/otelAdapters/clickhouseCollector.ts as the future export
  path, with the explicit caveat that it throws today

Net effect: the next agent or human running deco-migrate against a
fresh site repo gets observability guidance that matches the
framework currently on npm (5.0.0).

Co-authored-by: Cursor <cursoragent@cursor.com>
@vibe-dex
vibe-dex merged commit 95d1f03 into main May 8, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant