Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Monitor list filtering by tags is not returning data

Aperta
#2,063 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
ruby
Ambito
api

Direzione di ricerca

Inizia da datadog_api_client-2.27.1/lib/datadog_api_client/v1/api/monitors_api.rb:557 e riproduci la chiamata MonitorsAPI indicata con l’opzione tags. Confronta il parametro di query generato con l’endpoint dell’API Datadog e la relativa documentazione sul filtraggio. Il lavoro è completato quando la chiamata restituisce monitor che includono il tag richiesto invece di un elenco vuoto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Ruby
Stelle
46
Fork
21
Merge medio
2g 13h
PR unite (30g)
104

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DataDog/datadog-api-client-ruby

Tutte le issue di DataDog/datadog-api-client-ruby

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.