Newshot
Account

Vercel Tracing 正式可用,所有套餐均可使用

AI summary

Vercel Tracing 现已正式可用,所有套餐均可使用,定价与测试版一致。用户可在仪表盘或 Vercel CLI 中搜索和查看追踪数据,新建的 Next.js 项目默认启用追踪。仪表盘新增 Traces 页面,支持用 KQL 查询并可按项目或整个团队查看。

Translation(model translation, not the source's own text)

Vercel Tracing 现已在所有套餐中全面可用。你现在可以从仪表盘或 Vercel CLI 搜索并检查 trace,新建的 Next.js 项目默认启用 tracing。定价与 beta 阶段保持一致。

复制标题链接在仪表盘中浏览和搜索 trace

在 beta 阶段,你只能从 Logs 页面按请求逐个打开 trace。新的 Traces 页面在一个地方展示项目或整个团队的所有 trace 和 span。你可以在 Spans 列表和 Traces 列表之间切换,分别筛选,并使用 Kibana Query Language (KQL) 搜索。Live 模式会实时流式显示新到达的 trace。像 span.name:db* AND span.duration > 500 这样的查询可以按名称和时长缩小到较慢的数据库 span。

Project Traces

过去 30 分钟内有 132 个 span 匹配,显示最新的 10 个

TimeSpanServiceDuration
NOV 04 16:37:48.08waitUntilvercel.serverless-runtime3.79ms
NOV 04 16:37:48.07start responseacme-site0.02ms
NOV 04 16:37:48.07executing api route (app) /api/smoke-test/ping/[...slug]acme-site3.79ms
NOV 04 16:37:48.07resolve page componentsacme-site0.13ms
NOV 04 16:37:48.07GET /api/smoke-test/ping/[...slug]acme-site5.57ms
NOV 04 16:37:48.07Invoke Functionvercel.serverless-runtime15.6ms
NOV 04 16:37:48.06Resolve Deploymentvercel.edge-network9.69ms
NOV 04 16:37:48.06Microfrontends Routingvercel.edge-network1.34ms
NOV 04 16:37:48.05Resolve Routevercel.edge-network5.57ms
NOV 04 16:37:48.05Resolve Cachevercel.edge-network1.67ms

复制标题链接从 CLI 搜索 trace

Traces 页面使用与 vercel traces search --query 相同的 KQL,因此在仪表盘中构建的查询可以原样在 CLI 中运行。搜索范围覆盖你团队中的每个项目,或使用 --project 标志限定到一个项目。使用 vercel traces inspect <request-id> 检查单个 trace,使用 vercel traces config 管理项目的采样规则。


        vercel traces search --query 'span.duration > 2000'vercel traces search --status error --since 1h
      

查找超过两秒的 span,然后查看过去一小时内的所有错误。

复制标题链接为新建 Next.js 项目自动启用 tracing

在 beta 阶段,在你添加采样规则之前不会收集任何数据。从 Next.js 16.5 开始,在 Vercel 上创建且至少包含一个 Node.js 函数的新项目,会在首次成功构建后自动开启 tracing。Vercel 会添加一条对所有环境中 100% 请求进行采样的规则,并在构建时注入 instrumentation,因此 trace 无需任何设置即可包含 Next.js 框架 span。如需退出,请在 Settings → Tracing 中删除所有采样规则。

复制标题链接更长的保留期

在 beta 阶段,trace 的保留期跟随你的运行时日志保留期。现在 Hobby 套餐的 trace 保留期从 1 小时延长至 3 天,Pro 从 1 天延长至 14 天,Enterprise 从 3 天延长至 14 天。

阅读 Tracing 文档以了解更多。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by Vercel Blog
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗