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

enable language detection components only if both reporting and language detection are enabled

Open adel121 opened this issue 11 months ago • 1 comments

What does this PR do?

This PR checks for both language_detection.reporting.enabled and language_detection.enabled when deciding whether or not to activate components of language detection and library injection.

Motivation

Avoid unexpected behaviour in case of miss-configuration. For example, if language_detection.enabled is set to false, while language_detection.reporting.enabled is set to true, we should not activate any component, since it will lead to wasting resources for no benefit (e.g. enabling the deployment collector in workloadmeta, enabling the handler and patcher, etc.)

Additional Notes

  • This PR is opened for 7.53.0 since the existing behaviour impacts a feature that is in beta and doesn't cause failure, it only activates extra components in case of misconfiguration.

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

  • Ensure the components are still activated and work as expected in case of correct configuration (same QA as this PR)
  • Ensure that no extra components are activated in case language_detection.enabled is set to false whereas language_detection.reporting.enabled is set to true. (See sample QA below)

Deploying with the operator:

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  override:
    nodeAgent:
      containers:
        agent:
          env:
            - name: "DD_DOGSTATSD_TAG_CARDINALITY"
              value: "high"
            - name: "DD_LANGUAGE_DETECTION_ENABLED"
              value: "false"
            - name: "DD_LANGUAGE_DETECTION_REPORTING_ENABLED"
              value: "true"
            - name: "DD_LANGUAGE_DETECTION_REPORTING_BUFFER_PERIOD"
              value: "5s"
            - name: "DD_LANGUAGE_DETECTION_REPORTING_REFRESH_PERIOD"
              value: "10s"
            - name: "DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED"
              value: "true"
            - name: "DD_TELEMETRY_ENABLED"
              value: "true"
        process-agent:
          env:
            - name: "DD_LANGUAGE_DETECTION_ENABLED"
              value: "true"
            - name: "DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED"
              value: "true"
    clusterAgent:
      containers:
        cluster-agent:
          env:
            - name: "DD_LANGUAGE_DETECTION_ENABLED"
              value: "false"
            - name: "DD_CLUSTER_AGENT_LANGUAGE_DETECTION_PATCHER_ENABLED"
              value: "true"
            - name: "DD_CLUSTER_AGENT_LANGUAGE_DETECTION_CLEANUP_PERIOD"
              value: "15s"
            - name: "DD_CLUSTER_AGENT_LANGUAGE_DETECTION_CLEANUP_LANGUAGE_TTL"
              value: "30s"

Create any deployment.

Ensure that:

  • the deployment is not collected to workloadmeta (indicating that the kubeapiserver deployment collector is not activated)
  • no cluster agent logs shows that the language detection patcher was activated (e.g. Starting language detection patcher)
  • no agent log shows that the language detection client was activated (e.g. Starting language detection client)

adel121 avatar Mar 11 '24 13:03 adel121

Bloop Bleep... Dogbot Here

Regression Detector Results

Run ID: 21250623-a945-44e2-abbf-24583a989246 Baseline: d6a7e7927b96c58b1ca37d5a45453a1a457e3958 Comparison: 9e5bc7fea20b578ad3d7435ff68fe1ebb738826f

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00% Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI
file_to_blackhole % cpu utilization +0.28 [-6.28, +6.83]

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
basic_py_check % cpu utilization +0.84 [-1.44, +3.12]
otel_to_otel_logs ingress throughput +0.52 [-0.12, +1.16]
process_agent_real_time_mode memory utilization +0.31 [+0.27, +0.35]
file_to_blackhole % cpu utilization +0.28 [-6.28, +6.83]
process_agent_standard_check memory utilization +0.25 [+0.21, +0.28]
idle memory utilization +0.02 [-0.01, +0.05]
trace_agent_json ingress throughput +0.01 [-0.02, +0.04]
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.00, +0.00]
trace_agent_msgpack ingress throughput +0.00 [-0.00, +0.00]
uds_dogstatsd_to_api ingress throughput +0.00 [-0.00, +0.00]
file_tree memory utilization -0.07 [-0.14, +0.01]
process_agent_standard_check_with_stats memory utilization -0.14 [-0.18, -0.11]
tcp_syslog_to_blackhole ingress throughput -0.21 [-0.26, -0.16]
uds_dogstatsd_to_api_cpu % cpu utilization -1.09 [-2.52, +0.34]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

pr-commenter[bot] avatar Mar 11 '24 15:03 pr-commenter[bot]

/merge

clamoriniere avatar Mar 21 '24 16:03 clamoriniere

:steam_locomotive: MergeQueue

Pull request added to the queue.

There are 2 builds ahead! (estimated merge in less than 29m)

Use /merge -c to cancel this operation!

dd-devflow[bot] avatar Mar 21 '24 16:03 dd-devflow[bot]