Skip to content

v1 list_monitors cannot find monitor tags with spaces #1707

@chris-kiick-sp

Description

@chris-kiick-sp

Describe the bug
If a monitor has a tag whose key has spaces in it, then list_monitors() cannot find it by tag.

To Reproduce

  1. Go to 'Monitors'
  2. Click on 'Edit' (pencil icon) for any monitor
  3. Scroll down to 'tags'
  4. Add a new tag "Tag With Spaces"
  5. click 'Save'

run following python script:

from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import downtimes_api, monitors_api
from datadog_api_client.v1.models import *
import os

configuration = Configuration()
api_client = ApiClient(configuration)
monitor_api = monitors_api.MonitorsApi(api_client)

rv = monitor_api.list_monitors(with_downtimes=True, monitor_tags="Tag With Spaces")
print(len(rv))

Expected behavior
list_monitors() returns least one monitor that matches the tag

Environment and Versions (please complete the following information):
Python 3.11.4
datadog-api-client==2.17.0

There is nothing in API documentation or UI to suggest that tags with spaces are not supported.

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