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

MonitorUpdateRequest accepts illegal params

Open
#3,120 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start with datadog_api_client.v1.model.monitor_update_request.MonitorUpdateRequest and compare its accepted parameters with the Monitor.read_only_vars attribute mentioned in the issue. Read the model initialization path in datadog_api_client/model_utils.py, then verify that read-only monitor fields are excluded from update construction while valid update fields still work.

Written by the indexing model from the issue text.

Description

kind/bug stale

Describe the bug
The MonitorUpdateRequest class accepts several params that are read only attributes of a monitor and if you pass any value for one of these params creation of the MonitorUpdateRequest object fails and raises an Exception.

To Reproduce
Steps to reproduce the behavior:

  1. Import the MonitorUpdateRequest object
    from datadog_api_client.v1.model.monitor_update_request import MonitorUpdateRequest
  2. Follow the documentation for what params to pass when creating the object
  3. See error
>>> update = MonitorUpdateRequest(created=datetime(2025, 10, 20, 0, 6, 37, 825141))
Traceback (most recent call last):
  File "<python-input-9>", line 1, in <module>
    update = MonitorUpdateRequest(created=datetime(2025, 10, 20, 0, 6, 37, 825141))
  File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/v1/model/monitor_update_request.py", line 211, in __init__
    super().__init__(kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^
  File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/model_utils.py", line 445, in __init__
    raise ApiAttributeError(f"`{var_name}` is a read-only attribute.")
datadog_api_client.exceptions.ApiAttributeError: `created` is a read-only attribute.
>>> update = MonitorUpdateRequest(id=228483234)
Traceback (most recent call last):
  File "<python-input-10>", line 1, in <module>
    update = MonitorUpdateRequest(id=228483234)
  File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/v1/model/monitor_update_request.py", line 211, in __init__
    super().__init__(kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^
  File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/model_utils.py", line 445, in __init__
    raise ApiAttributeError(f"`{var_name}` is a read-only attribute.")
datadog_api_client.exceptions.ApiAttributeError: `id` is a read-only attribute.

Expected behavior
This class should not accept parameters that are restricted from being updated via the API as it exists solely to update monitors via the API

Environment and Versions (please complete the following information):
datadog-api-client v2.50.0

Additional context
This issue was hit when i was trying to bulk update existing monitors. The workflow was get monitor details from the API, edit them with the changes i wanted, then update the monitor. I had to loop through all the params to identify the read-only ones before i discovered the Monitor.read_only_vars attribute

Dominant language
Python
Stars
166
Forks
55
Avg merge
2d 17h
Merged PRs (30d)
73

Contributor guide

Open the 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-python

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

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.