Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Use typed detector schemas from @sentry/api for metric monitors

オープン
#1,595 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 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> and condition_group.conditions?: Array<unknown>. config is { [key: string]: unknown }.
  • GetOrganizationDetectorResponses[200]: dataSources, conditionGroup, and config are all { [key: string]: unknown }.
  • The accepted values appear only in doc comments: dataset, queryType, eventTypes, timeWindow, condition type/comparison/conditionResult, and detectionType/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 in getsentry/sentry so 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-monitor and the CLI/MCP casts for the generated types and schemas, and bump @sentry/api in both packages.

Raised by @BYK in review on #1591.

via BYK.

--

View Junior Session [Sentry]

主要言語
TypeScript
スター
938
フォーク
166
平均マージ
1日 5時間
マージ済み PR(30日)
171

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/toolkit のほかの issue

getsentry/toolkit の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。