Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error fetching monitor with mtd cummulative window starting on custom day

Open Beginner friendly
#3,592 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
openapi, ruby
Domain
api

Research direction

Start in lib/datadog_api_client/v1/models/monitor_options_scheduling_options_evaluation_window.rb at the month_starts validation referenced in the issue, then reproduce the failure with client.get_monitor(306920871) or an equivalent month-to-date monitor using a custom start day. Done means fetching and listing such monitors no longer raises the reported ArgumentError.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Ruby
Stars
45
Forks
20
Avg merge
3d 2h
Merged PRs (30d)
80

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/datadog-api-client-ruby

All issues in DataDog/datadog-api-client-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.