datadog-operator
datadog-operator copied to clipboard
DatadogAgentProfiles valid metric
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 (ordatadogagentprofile_valid
with curl) with tagdatadogagentprofile:xxx
has a value of1
for the valid profile and0
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/ordependencies
- [x] PR has a milestone or the
qa/skip-qa
label