You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
see https://docs.datadoghq.com/workflows/actions_catalog/monitor_validatemonitor/
only works for monitors ... another option could be to "apply + revert" for others and then get errors from that
... or validating with a deliberate error so we get "expected failure + unknown failure" and then sort out the unknown
The text was updated successfully, but these errors were encountered:
desc"Validate resources against datadog api using generated/ (atm monitor only) [PROJECT|TRACKING_ID|FILE=]"taskvalidate: "kennel:environment"dofiles=if(project=ENV["PROJECT"])Dir["generated/#{project}/*.json"]elsif(id=ENV["TRACKING_ID"])Dir["generated/#{id.split(":").join("/")}.json"]elsif(file=ENV["FILE"])fileelseraise"Need PROJECT or TRACKING_ID or FILE"endmonitors=files.map{ |f| [f,JSON.parse(File.read(f))]}.select{ |_,r| r["api_resource"] == "monitor"}raise"No monitors in selected files"ifmonitors.empty?monitors.eachdo |file,monitor|
beginKennel::Api.new.create("monitor/validate",monitor)puts"#{file}: Valid"rescueStandardErrorputs"#{file}:"body= $!.message.split("\n").last# parsing api output from what lib/kennel/api.rb addsputsJSON.parse(body).fetch("errors")endendend
to make this work for dashboard we could add a fake broken widget and then see if the error coming back is that widget, if it is then we know it's valid
(this way we don't do any real updates ... but it's still risky)
for slo we'd need a similar scheme but might be even harder / less reliable
see https://docs.datadoghq.com/workflows/actions_catalog/monitor_validatemonitor/
only works for monitors ... another option could be to "apply + revert" for others and then get errors from that
... or validating with a deliberate error so we get "expected failure + unknown failure" and then sort out the unknown
The text was updated successfully, but these errors were encountered: