datadog-operator icon indicating copy to clipboard operation
datadog-operator copied to clipboard

DatadogAgentProfiles valid metric

Open khewonc opened this issue 8 months ago • 1 comments

What does this PR do?

Includes code from https://github.com/DataDog/datadog-operator/pull/1224, which should be merged first

Adds a metric for valid/invalid DatadogAgentProfiles:

# HELP datadogagentprofile_valid 1 if the DatadogAgentProfile is valid. 0 if the DatadogAgentProfile is invalid
# TYPE datadogagentprofile_valid gauge
datadogagentprofile_valid{datadogagentprofile="dap-test"} 1
datadogagentprofile_valid{datadogagentprofile="invalid-dap"} 0

Motivation

https://datadoghq.atlassian.net/browse/CECO-1241

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

  • Spin up an operator with profiles enabled
  • Apply a DDA and a valid profile and an invalid profile (one way is to remove the profileAffinity section)
  • Check that the metric datadog.operator.datadogagentprofile_valid in app (or datadogagentprofile_valid with curl) with tag datadogagentprofile:xxx has a value of 1 for the valid profile and 0 for the invalid profile
# check via curl (below) or in app
kubectl exec -it <operator> -- curl localhost:8383/metrics
  • Delete one or both of the profiles
  • Check that the corresponding metric(s) is deleted

Checklist

  • [x] PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • [x] PR has a milestone or the qa/skip-qa label

khewonc avatar Jun 21 '24 19:06 khewonc