Skip to content

Requested timeout for listing and searching monitors. #2466

Open
@ignasiduran

Description

@ignasiduran

I have some concerns about how the datadog-api-client library interacts with the Datadog API.

Specifically, in the case of monitors, when calling the list_monitors() function (https://datadog-api-client.readthedocs.io/en/latest/datadog_api_client.v1.api.html#datadog_api_client.v1.api.monitors_api.MonitorsApi.list_monitors), we receive a Requested timeout error after approximately 10 seconds.

The same happens with search_monitors() (https://datadog-api-client.readthedocs.io/en/latest/datadog_api_client.v1.api.html#datadog_api_client.v1.api.monitors_api.MonitorsApi.search_monitors).

I understand that the timeout occurs because the API call returns a very large dataset and exceeds the allowed time. If we use "filters" in the API requests and the response dataset is small, the timeout does not occur. Goes very well.

We are using pagination in these functions like:

while True:
    monitors = self.monitors_api.list_monitors(
        name=monitor_name,
        monitor_tags=tags, 
        page=page,
        page_size=page_size, 
        with_downtimes=True
    )

    if not monitors:
        break

    all_monitors.extend(monitors)
    page += 1
    time.sleep(1)

However, the timeout duration appears to remain the same.

We also pass the Configuration object to the Datadog API client (APIClient), including the request_timeout parameter (https://datadog-api-client.readthedocs.io/en/latest/datadog_api_client.v1.html#datadog_api_client.v1.Configuration), but the timeout behavior still seems unchanged.

Could you have some information about how the datadog-api-client call timeout works and whether it is possible to modify it?

Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions