[Cloudflare] instrumentWorkflowWithSentry does not capture a NonRetryableError thrown before the final attempt
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
先阅读 instrumentWorkflowWithSentry 和 WrappedWorkflowStep.do,尤其是 instrumentedCallback,目前是否捕获取决于尝试次数。检查现有的 Cloudflare workflow instrumentation 测试,并补充对最后一次重试之前抛出 NonRetryableError 的测试。完成标准是该失败会产生一个 Sentry 事件,同时仍有测试覆盖重试次数耗尽时的行为。
由索引模型根据 Issue 内容生成。
描述
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
Related: #17421, #21025
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/cloudflare
SDK Version
11.9.0 (the code is the same in 11.10.0 and on develop)
Framework Version
wrangler 4.98.0, compatibility_date 2025-06-04
Reproduction Example/SDK Setup
import { WorkflowEntrypoint } from 'cloudflare:workers'
import { NonRetryableError } from 'cloudflare:workflows'
import * as Sentry from '@sentry/cloudflare'
class MyWorkflow extends WorkflowEntrypoint<Env, Params> {
async run(event, step) {
await step.do('load', { retries: { limit: 2, delay: '1 second' } }, async () => {
throw new NonRetryableError('permanent failure')
})
}
}
export const Instrumented = Sentry.instrumentWorkflowWithSentry(
(env) => ({ dsn: env.SENTRY_DSN }),
MyWorkflow,
)
Steps to Reproduce
- Wrap a Workflow with
instrumentWorkflowWithSentry. - Throw a
NonRetryableErrorin astep.dowithretries.limit > 0. - Trigger an instance.
Expected Result
One Sentry event for the NonRetryableError that ends the instance.
Actual Result
No event. WrappedWorkflowStep.do only captures when attempt > retries.limit, and a NonRetryableError ends the instance on attempt 1. Regression since 10.56.0 (#21025): before, the step error was captured on every attempt, so it was reported.
Additional Context
#17421 asked for one error "once all step.do retries have been exhausted, or on a NonRetryableError". #21025 covered only the first case.
Suggested fix: in instrumentedCallback, also capture when error.name === 'NonRetryableError'. I'm happy to open a PR with integration tests.
- 主要语言
- TypeScript
- 星标
- 8.8k
- 派生
- 1.9k
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 682
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-javascript 的其他 Issue
-
Workers AI integration drops output of non-streaming chat responses in the OpenAI format (`choices`)未关闭Bug Cloudflare Workers Spans
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-javascript#26120 · 1 条评论 ·
维护者通常 1 天内回复
-
Vercel AI: `gen_ai.system_instructions` is missing when the system prompt is a message object可能已有人在做 @biggdawg320 于 1 天前认领。 未关闭Bug Package: node Spans vercel ai
难度 2/5 1-3 小时 新手友好度 73/100
getsentry/sentry-javascript#26079 · 1 条评论 ·
维护者通常 1 天内回复
-
fsIntegration crashes in native ESM when patching the read-only fs namespace可能已有人在做 @chargome 于 1 天前认领。 未关闭Bug Node.js Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 68/100
getsentry/sentry-javascript#25950 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
normalize() throws when a getter throws a Symbol or a null-prototype object可能已有人在做 @rjmcgee53192 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-javascript#25920 · 2 条评论 ·
维护者通常 1 天内回复
-
Only create Nuxt database and storage spans when there is a parent span可能已有人在做 @nicohrubec 于 6 天前认领。 未关闭Improvement Nuxt
难度 2/5 1-3 小时 新手友好度 83/100
getsentry/sentry-javascript#25805 · 2 条评论 ·
维护者通常 1 天内回复
查看 getsentry/sentry-javascript 的全部 Issue
相似的 Issue
-
[Text] Add Reading Time & Word Count Estimator for Reflection Notes in src/lib/text/reading-time.ts未关闭area:core beginner-friendly community contributions-welcome difficulty:easy enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
[fullsend] E2E: scorecard — filecheck GitLab entity metrics unavailable due to initialDelay timing未关闭e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 75/100
redhat-developer/rhdh-plugin-export-overlays#4698 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
devswha/herdr-web-ui#2884 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
b:minor bug
难度 2/5 1-3 小时 新手友好度 78/100
software-mansion/argent#1771 ·
维护者通常 1 天内回复