Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 list_monitors cannot find monitor tags with spaces #1707

Open
chris-kiick-sp opened this issue Oct 5, 2023 · 2 comments
Open

v1 list_monitors cannot find monitor tags with spaces #1707

chris-kiick-sp opened this issue Oct 5, 2023 · 2 comments

Comments

@chris-kiick-sp
Copy link

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.

@therve
Copy link
Contributor

therve commented Oct 6, 2023

Hi,

Indeed the list API doesn't seem to support tags with space. Overall spaces in tags are somewhat discouraged, but I agree with you they are not forbidden. I reached out to the monitor team to see if they can fix this. Thanks for you patience.

Copy link

github-actions bot commented Nov 6, 2023

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants