Skip to content

feat(core): emit faas.instance span attribute for compute instance identity#2989

Draft
alangenfeld wants to merge 1 commit into
mainfrom
alangenfeld/faas-instance-attr
Draft

feat(core): emit faas.instance span attribute for compute instance identity#2989
alangenfeld wants to merge 1 commit into
mainfrom
alangenfeld/faas-instance-attr

Conversation

@alangenfeld

@alangenfeld alangenfeld commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What

Synthesize a per-instance id (cinst_<ulid>, minted once at module load) and emit it as the OpenTelemetry faas.instance span attribute on the flow and step route spans.

Why

Vercel exposes no native per-instance id under Fluid compute (all AWS_LAMBDA_* env vars are blocked), yet Fluid packs concurrent invocations onto one instance. This attribute tells traces which instance handled each request — the basis for observability that distinguishes steps sharing an instance from those that don't.

Scope / risk

Purely additive: a new span attribute behind the existing span?.setAttributes. No wire-format, schema, or behavior change; no cross-repo dependency; usable now via any OTEL backend.

First of a short series — later PRs persist the same id on step_started events to drive the observability UI.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 17, 2026 8:56pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 17, 2026 8:56pm
example-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-express-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 17, 2026 8:56pm
workflow-swc-playground Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workflow-tarballs Ready Ready Preview, Comment Jul 17, 2026 8:56pm
workflow-web Ready Ready Preview, Comment Jul 17, 2026 8:56pm

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d1b2338

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

This PR includes changesets to release 16 packages
Name Type
@workflow/core Minor
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
workflow Minor
@workflow/world-testing Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/nuxt Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite 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

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit d1b2338 · Fri, 17 Jul 2026 21:11:33 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1208 (-4.6%) 1704 🔴 1777 🔴 2079 🔴 30
TTFS hook + stream 1603 (+21%) 1956 🔴 1993 🔴 2081 🔴 30
STSO 1020 steps (1-20) 289 (-3.2%) 349 🔴 472 🔴 492 🔴 19
STSO 1020 steps (101-120) 328 (+6.3%) 373 🔴 521 🔴 684 🔴 19
STSO 1020 steps (1001-1020) 753 (+20%) 822 🔴 841 🔴 910 🔴 19
WO stream 1208 (-4.6%) 1704 1777 2079 30
WO hook + stream 1603 (+21%) 1956 1993 2081 30
SL stream 3524 (+253%) 5720 🔴 5792 🔴 5821 🔴 30
SL hook + stream 4306 (+121%) 5559 🔴 5625 🔴 5691 🔴 30
📜 Previous results (2)

5e0e611

Fri, 17 Jul 2026 19:14:49 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1264 (±0%) 1600 🔴 1664 🔴 1793 🔴 30
TTFS hook + stream 1396 (+5.1%) 1807 🔴 1864 🔴 2247 🔴 30
STSO 1020 steps (1-20) 261 (-13%) 293 🔴 327 🔴 549 🔴 19
STSO 1020 steps (101-120) 318 (+3.0%) 362 🔴 419 🔴 550 🔴 19
STSO 1020 steps (1001-1020) 713 (+14%) 765 🔴 822 🔴 839 🔴 19
WO stream 1264 (±0%) 1600 1664 1793 30
WO hook + stream 1396 (+5.1%) 1807 1864 2247 30
SL stream 3653 (+265%) 5740 🔴 5841 🔴 6124 🔴 30
SL hook + stream 3422 (+75%) 5507 🔴 5676 🔴 6323 🔴 30

ad3b139

Fri, 17 Jul 2026 18:50:22 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1481 (+17%) 1751 🔴 1787 🔴 2141 🔴 30
TTFS hook + stream 1540 (+16%) 2000 🔴 2035 🔴 2246 🔴 30
STSO 1020 steps (1-20) 262 (-12%) 311 🔴 363 🔴 369 🔴 19
STSO 1020 steps (101-120) 275 (-11%) 294 🔴 344 🔴 414 🔴 19
STSO 1020 steps (1001-1020) 729 (+17%) 755 🔴 860 🔴 1024 🔴 19
WO stream 1481 (+17%) 1751 1787 2141 30
WO hook + stream 1540 (+16%) 2000 2035 2246 30
SL stream 3776 (+278%) 5785 🔴 5881 🔴 6488 🔴 30
SL hook + stream 3859 (+98%) 5582 🔴 5684 🔴 5941 🔴 30

Avg deltas compare against the most recent benchmark run on main at the time of this run.

Metrics — TTFS: time to first step body execution · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (time outside step bodies, client start → last step body exit) · SL: stream latency (first chunk write → visible to the reader)

Scenarios — stream: one step that streams chunks back to the client; no hooks, so the run stays in turbo mode · hook + stream: registers a hook before the same streaming step, which exits turbo mode · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges

🟢/🔴 mark percentiles within/above target. Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · STSO (1-20) 20/30/60 · STSO (101-120) 30/45/90 · STSO (1001-1020) 40/60/120

TTFS/WO compare client vs deployment clocks and SL compares the step runner’s clock vs the client’s (NTP-synced in CI). WO ends at the last step body exit, the closest observable proxy for the final step-completion request.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1453 0 230 1683
✅ 💻 Local Development 1617 0 219 1836
✅ 📦 Local Production 1617 0 219 1836
✅ 🐘 Local Postgres 1617 0 219 1836
✅ 🪟 Windows 153 0 0 153
✅ 📋 Other 894 0 177 1071
✅ vercel-multi-region 27 0 0 27
Total 7378 0 1064 8442

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 126 0 27
✅ example 126 0 27
✅ express 126 0 27
✅ fastify 126 0 27
✅ hono 126 0 27
✅ nextjs-turbopack 150 0 3
✅ nextjs-webpack 150 0 3
✅ nitro 126 0 27
✅ nuxt 126 0 27
✅ sveltekit 145 0 8
✅ vite 126 0 27
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 153 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 128 0 25
✅ e2e-local-dev-tanstack-start- 128 0 25
✅ e2e-local-postgres-nest-stable 128 0 25
✅ e2e-local-postgres-tanstack-start- 128 0 25
✅ e2e-local-prod-nest-stable 128 0 25
✅ e2e-local-prod-tanstack-start- 128 0 25
✅ e2e-vercel-prod-tanstack-start 126 0 27
✅ vercel-multi-region
App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

📋 View full workflow run

@alangenfeld
alangenfeld force-pushed the alangenfeld/faas-instance-attr branch from ad3b139 to 5e0e611 Compare July 17, 2026 18:57
…entity

Synthesize a per-warm-instance id (cinst_<ulid>) once at module load and emit it as the OTEL faas.instance attribute on the flow and step route spans. Vercel exposes no native per-instance id under Fluid compute, so this lets traces distinguish which compute instance handled each request. Purely additive telemetry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
@alangenfeld
alangenfeld force-pushed the alangenfeld/faas-instance-attr branch from 5e0e611 to d1b2338 Compare July 17, 2026 20:53
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