Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Monitor list filtering by tags is not returning data

Ouverte
#2,063 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

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
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
ruby
Domaine
api

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

kind/bug stale

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:

  1. Add the tag "my-tag" to a couple of monitors
  2. Call the API to list these monitors
DatadogAPIClient::V1::MonitorsAPI.new(@client).list_monitors({ tags: "my-tag"})
  1. 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

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de DataDog/datadog-api-client-ruby

Toutes les issues de DataDog/datadog-api-client-ruby

Issues similaires

Plus d'issues Ruby

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.