Use typed detector schemas from @sentry/api for metric monitors
Maintainer thường phản hồi trong vòng 1 ngày
@MathurAditya724 đang làm issue này rồi.
Từ ngày 22/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
@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.
--
- Ngôn ngữ chính
- TypeScript
- Star
- 938
- Fork
- 166
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 156
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/toolkit
-
bug MCP
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/toolkit#1600 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
getsentry/toolkit#1471 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
getsentry/toolkit#1611 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement MCP
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
getsentry/toolkit#1601 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 43/100
getsentry/toolkit#1564 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của getsentry/toolkit
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
source-cooperative/docs.source.coop#41 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Nimblesite/SharpLsp#468 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
solidjs-community/solid-primitives#1082 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày