Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatadogAgentProfiles valid metric #1245

Merged
merged 3 commits into from
Jul 11, 2024
Merged

DatadogAgentProfiles valid metric #1245

merged 3 commits into from
Jul 11, 2024

Conversation

khewonc
Copy link
Contributor

@khewonc khewonc commented Jun 21, 2024

What does this PR do?

Includes code from #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

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

@khewonc khewonc added the enhancement New feature or request label Jun 21, 2024
@khewonc khewonc added this to the v1.8.0 milestone Jun 21, 2024
@khewonc khewonc requested review from a team as code owners June 21, 2024 19:23
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 54.98%. Comparing base (d0f739b) to head (3119d08).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1245      +/-   ##
==========================================
- Coverage   54.99%   54.98%   -0.02%     
==========================================
  Files         243      243              
  Lines       28023    28031       +8     
==========================================
+ Hits        15411    15412       +1     
- Misses      11741    11747       +6     
- Partials      871      872       +1     
Flag Coverage Δ
unittests 54.98% <46.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ontrollers/datadogagent/controller_reconcile_v2.go 53.91% <75.00%> (ø)
pkg/agentprofile/agent_profile.go 63.35% <66.66%> (+0.03%) ⬆️
controllers/metrics/datadogagentprofile.go 66.66% <33.33%> (-33.34%) ⬇️
controllers/datadogagent_controller.go 67.82% <20.00%> (-2.98%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0f739b...3119d08. Read the comment docs.

@khewonc khewonc force-pushed the khewonc/dap-valid-metric branch 2 times, most recently from dc2579e to 70a3e81 Compare June 25, 2024 19:43
@khewonc khewonc merged commit c72fc48 into main Jul 11, 2024
19 checks passed
@khewonc khewonc deleted the khewonc/dap-valid-metric branch July 11, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants