Monitor list filtering by tags is not returning data
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Commencez à datadog_api_client-2.27.1/lib/datadog_api_client/v1/api/monitors_api.rb:557 et reproduisez l’appel MonitorsAPI indiqué avec l’option tags. Comparez le paramètre de requête généré avec le endpoint de l’API Datadog et sa documentation sur le filtrage. C’est terminé lorsque l’appel renvoie des monitors portant le tag demandé plutôt qu’une liste vide.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
Calling the list monitors method with options to filter by tags is not working. It returns an empty list. I have a couple of monitors with the "my-tag" tag, and I have already checked that these monitors are returned if I don't use filters, including the one with the tag.
To Reproduce
Steps to reproduce the behavior:
- Add the tag "my-tag" to a couple of monitors
- Call the API to list these monitors
DatadogAPIClient::V1::MonitorsAPI.new(@client).list_monitors({ tags: "my-tag"})
- Debug the DatadogAPIClient::V1::MonitorsAPI request.
Debugging the code at datadog_api_client-2.27.1/lib/datadog_api_client/v1/api/monitors_api.rb:557 shows that the information sent to the API is correct:
{
:tags=>"my-tag",
:operation=>:list_monitors,
:header_params=>{"Accept"=>"application/json"},
:query_params=> {
:tags=>"my-tag"
},
:form_params=>{},
:body=>nil,
:auth_names=>[:apiKeyAuth, :appKeyAuth, :AuthZ],
:return_type=>"Array<Monitor>",
:api_version=>"V1"
}
However, it returns an empty list:
[7] pry(#<DatadogAPIClient::V1::MonitorsAPI>)> @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
=> [[],
200,
{"date"=>["Thu, 17 Oct 2024 09:02:16 GMT"],
"content-type"=>["application/json"],
"content-length"=>["3"],
"etag"=>["..."],
"x-frame-options"=>["SAMEORIGIN"],
"content-security-policy"=>["..."],
"x-ratelimit-limit"=>["1000"],
"x-ratelimit-period"=>["10"],
"x-ratelimit-remaining"=>["999"],
"x-ratelimit-reset"=>["4"],
"x-ratelimit-name"=>["get_all_monitors"],
"x-content-type-options"=>["nosniff"],
"strict-transport-security"=>["max-age=31536000; includeSubDomains; preload"],
"via"=>["1.1 google"],
"alt-svc"=>["h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"],
"connection"=>["close"]}]
Expected behavior
It returns the list of monitors with the mentioned tag.
Screenshots
n/a
Environment and Versions (please complete the following information):
- ruby version 3.3.5
- gem version
datadog_api_client-2.27.1 - gem service
DatadogAPIClient::V1::MonitorsAPI
Additional context
The seems to be in the API itself https://api.datadoghq.eu/api/v1/monitor or maybe the query parameter to filter tags has a different name.
- Langage dominant
- Ruby
- Étoiles
- 46
- Forks
- 21
- Merge moyen
- 2 j 13 h
- PR mergées (30 j)
- 104
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de DataDog/datadog-api-client-ruby
-
kind/bug stale
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
DataDog/datadog-api-client-ruby#3592 · 3 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
DD Kubernetes API supportOuvertekind/feature-request stale
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
DataDog/datadog-api-client-ruby#1438 · 3 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de DataDog/datadog-api-client-ruby
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 10 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 2 jours
-
area: devops area: integration help wanted lane: free-agent roadmap size: S type: fixture
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
arminazimi/evergreen#1505 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
waiting-intake
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100