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

[CECO-1238] Configure checks tag cardinality within `spec.global.checksTagCardinality`

Open tbavelier opened this issue 1 year ago • 1 comments

What does this PR do?

  • Similar to https://github.com/DataDog/datadog-operator/commit/3efc80aca617e12442ba4f6972fbfa5fdf7791a1, provides a way to directly configure the checks tag cardinality from the Agent CR without having to define an env var override
  • As this is not a specific feature, it's configured within global

Motivation

  • https://datadoghq.atlassian.net/browse/CECO-1238
  • Ease of configuration & Helm parity

Minimum Agent Versions

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

Describe your test plan

  1. make IMG=<replace me> deploy to deploy the image and CRDs in system namespace
  2. Test the following scenarios and ensure the results are adequate:
    1. apiVersion: datadoghq.com/v2alpha1
      kind: DatadogAgent
      metadata:
        name: datadog
      spec:
        global:
          checksTagCardinality: orchestrator
      

      Scenario : tag cardinality set to orchestrator

      • [ ] Ensure the Agent env var DD_CHECKS_TAG_CARDINALITY is set to orchestrator:
      kubectl describe pod <NODE AGENT POD> | grep "DD_CHECKS_TAG_CARDINALITY"
      
      • [ ] Ensure the Agent cardinality is set to orchestrator :
      k exec -it <NODE AGENT NAME> -- agent config | grep checks_tag_cardinality
      
      image
    2. apiVersion: datadoghq.com/v2alpha1
      kind: DatadogAgent
      metadata:
        name: datadog
      spec:
        global:
          checksTagCardinality: illegal_value
      

      Scenario : tag cardinality set to illegal_value

      • [ ] Ensure the Agent env var DD_CHECKS_TAG_CARDINALITY is set to illegal_value:
      kubectl describe pod <NODE AGENT POD> | grep "DD_CHECKS_TAG_CARDINALITY"
      
      image
      • [ ] Ensure the Agent cardinality defaults to low by asserting the presence of the log mentioning the value is illegal :
      k logs <NODE AGENT POD> | grep "check tag cardinality"
      
      image
    3. Remove global.checksTagCardinality from your Agent CR Scenario : no checks tag cardinality

      • [ ] Assert the absence of DD_CHECKS_TAG_CARDINALITY env var on the node Agent image

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

tbavelier avatar Jul 24 '24 12:07 tbavelier

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 48.88%. Comparing base (583f3ec) to head (61a6a27). :warning: Report is 345 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1309      +/-   ##
==========================================
+ Coverage   48.85%   48.88%   +0.03%     
==========================================
  Files         226      226              
  Lines       20132    20144      +12     
==========================================
+ Hits         9835     9847      +12     
  Misses       9782     9782              
  Partials      515      515              
Flag Coverage Δ
unittests 48.88% <100.00%> (+0.03%) :arrow_up:

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

Files with missing lines Coverage Δ
api/datadoghq/v2alpha1/datadogagent_types.go 100.00% <ø> (ø)
api/datadoghq/v2alpha1/test/builder.go 92.04% <100.00%> (+0.04%) :arrow_up:
...nternal/controller/datadogagent/override/global.go 47.81% <100.00%> (+1.40%) :arrow_up:

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 583f3ec...61a6a27. Read the comment docs.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jul 24 '24 12:07 codecov-commenter

/merge

tbavelier avatar Nov 18 '24 16:11 tbavelier

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-11-18 16:44:31 UTC :information_source: MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Note: if you pushed new commits since the last approval, you may need additional approval. You can remove it from the waiting list with /remove command.


2024-11-18 16:47:54 UTC :warning: MergeQueue: This merge request was unqueued

This merge request was unqueued

dd-devflow[bot] avatar Nov 18 '24 16:11 dd-devflow[bot]

/remove

tbavelier avatar Nov 18 '24 16:11 tbavelier

Devflow running: /remove

View all feedbacks in Devflow UI.


2024-11-18 16:47:51 UTC :information_source: Devflow: /remove

dd-devflow[bot] avatar Nov 18 '24 16:11 dd-devflow[bot]

/merge

tbavelier avatar Nov 19 '24 09:11 tbavelier

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-11-19 09:23:51 UTC :information_source: MergeQueue: pull request added to the queue

The median merge time in main is 15m.

dd-devflow[bot] avatar Nov 19 '24 09:11 dd-devflow[bot]