Error fetching monitor with mtd cummulative window starting on custom day
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
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
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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/datadog-api-client-ruby
-
kind/bug stale
Difficulty 3/5 1-2 days Newbie friendliness 35/100
DataDog/datadog-api-client-ruby#2063 · 3 comments ·
Maintainers usually reply within 2 days
-
kind/feature-request stale
Difficulty 5/5 Over a week Newbie friendliness 25/100
DataDog/datadog-api-client-ruby#1438 · 3 comments · 1 reaction ·
Maintainers usually reply within 2 days
All issues in DataDog/datadog-api-client-ruby
Similar issues
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
benbalter/jekyll-include-cache#55 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
grafana/pyroscope#5729 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rubygems/rubygems.org#6895 ·
Maintainers usually reply within 1 day