Use typed detector schemas from @sentry/api for metric monitors
维护者通常 1 天内回复
@MathurAditya724 已经在做这个了。
开始于 2026年10月22日。
评估
这个 Issue 还没有评估数据。
描述
@sentry/api leaves the detector (monitor) payloads mostly untyped. Because of that, toolkit has to keep its own copy of the metric monitor data source and condition values.
Checked against @sentry/api 0.381.0, the latest release. The CLI pins ^0.356.0 and mcp-core pins 0.337.0.
Gaps in types.gen.d.ts
Create/UpdateOrganizationDetectorData:data_sources?: Array<unknown>andcondition_group.conditions?: Array<unknown>.configis{ [key: string]: unknown }.GetOrganizationDetectorResponses[200]:dataSources,conditionGroup, andconfigare all{ [key: string]: unknown }.- The accepted values appear only in doc comments:
dataset,queryType,eventTypes,timeWindow, conditiontype/comparison/conditionResult, anddetectionType/comparisonDelta. The generated zod and valibot schemas have the same gaps.
Workaround today
#1591 adds @sentry/toolkit-core/metric-monitor. It hand-copies these values from Sentry's SnubaQueryValidator (QUERY_TYPE_VALID_DATASETS / QUERY_TYPE_VALID_EVENT_TYPES) and MetricIssueComparisonConditionValidator. The CLI (packages/cli/src/types/metric-alert.ts, packages/cli/src/lib/api/alerts.ts) and MCP (packages/mcp-core/src/tools/support/metric-monitor-config.ts) both consume that module and cast detector bodies through unknown.
Ask
- Get typed detector schemas into
@sentry/api, likely by adding typed serializers or validators for the detector endpoints ingetsentry/sentryso the generated OpenAPI spec carries them:- a snuba-query data source (dataset / queryType / eventTypes enums)
- metric comparison and anomaly conditions
- detection config
- Once those land, swap
@sentry/toolkit-core/metric-monitorand the CLI/MCP casts for the generated types and schemas, and bump@sentry/apiin both packages.
Raised by @BYK in review on #1591.
via BYK.
--
- 主要语言
- TypeScript
- 星标
- 938
- 派生
- 166
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 156
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/toolkit 的其他 Issue
-
bug MCP
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/toolkit#1600 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
getsentry/toolkit#1471 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
getsentry/toolkit#1611 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement MCP
难度 4/5 1-2 天 新手友好度 55/100
getsentry/toolkit#1601 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 43/100
getsentry/toolkit#1564 · 1 条评论 ·
维护者通常 1 天内回复
查看 getsentry/toolkit 的全部 Issue
相似的 Issue
-
level/task type/bug
难度 2/5 1-3 小时 新手友好度 75/100
wazuh/wazuh-dashboard-plugins#9508 ·
维护者通常 1 天内回复
-
Testnet EOL page links Zonescan mainnet可能已有人在做 @napelvs 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 78/100
Azure-Samples/azure-search-openai-demo#3249 ·
维护者通常 1 天内回复
-
[Docs] docs/architecture.mermaid leaves out 21 of the 51 src/ directories可能已有人在做 @uyg7x 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
enhancement status:needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
dongdongbh/Mindwtr#1438 ·
维护者通常 1 天内回复