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

Error fetching monitor with mtd cummulative window starting on custom day

オープン 初心者向け
#3,592 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
openapi, ruby
領域
api

調査の方向性

lib/datadog_api_client/v1/models/monitor_options_scheduling_options_evaluation_window.rb の issue で参照されている month_starts のバリデーションから始め、client.get_monitor(306920871) またはカスタムの開始日を使用する同等の month-to-date モニターで失敗を再現します。完了条件は、そのようなモニターの取得と一覧表示で、報告された ArgumentError が発生しなくなることです。

索引モデルが issue の本文から書いたものです。

説明

kind/bug stale

Describe the bug

If I create a monitor with a custom starting day (eg: 17) for a month long cumulative window, trying to get the monitor, or list the monitor results in an exception being thrown.

ArgumentError: invalid value for "month_starts", must be smaller than or equal to 1.

To Reproduce

Create a metric monitor with a cummulative window, month to date, starting on any date but 1.

Example:

{
	"id": 306920871,
	"name": "wesley datadog api bug with custom start date for month to date",
	"type": "query alert",
	"query": "avg(current_1mo):avg:system.load.1{*} > 100",
	"message": "",
	"tags": [],
	"options": {
		"thresholds": {
			"critical": 100
		},
		"notify_audit": false,
		"on_missing_data": "default",
		"include_tags": false,
		"scheduling_options": {
			"evaluation_window": {
				"month_starts": 17,
				"day_starts": "00:00",
				"timezone": "UTC"
			}
		},
		"new_host_delay": 300
	},
	"priority": null,
	"draft_status": "draft",
	"assets": []
}

Attempt to fetch the monitor by id

client.get_monitor(306920871)

Expected behavior

No exception raised.

The generated code for month_starts= seems overly strict in this case

https://github.com/DataDog/datadog-api-client-ruby/blob/master/lib/datadog_api_client/v1/models/monitor_options_scheduling_options_evaluation_window.rb#L122

Environment and Versions:

Ruby: 3.3.11
Version: 2.32.0

Additional context
Add any other context about the problem here.

主要言語
Ruby
スター
45
フォーク
20
平均マージ
3日 16時間
マージ済み PR(30日)
81

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

DataDog/datadog-api-client-ruby のほかの issue

DataDog/datadog-api-client-ruby の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

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

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