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

[CONTP-477] Add workload store to DCA for storing fail over application load from node agent #30562

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

zhuminyi
Copy link
Contributor

@zhuminyi zhuminyi commented Oct 28, 2024

What does this PR do?

Follow up PR, a http server is implemented in datadog-cluster-agent to

  1. deserialize the workload data payload from node agent
  2. store the workload metrics information (e.g container.cpu/memory) in data store (in-memory). Maximum 3 datapoints are stored per entity.
  3. The old data points are purged periodically
  4. Define query function to dump the data by metric name/namespace/deployment(podOwner)

Telemetry added
datadog.cluster_agent.autoscaling_workload_store_load_entities

Interface

type Store interface {
	// SetEntitiesValues sets the values for the given map
	SetEntitiesValues(entities map[*Entity]*EntityValue)

	// GetStoreInfo returns the store information.
	GetStoreInfo() StoreInfo

	// GetMetricsRaw provides the values of qualified entities by given search filters
	GetMetricsRaw(metricName string, namespace string, podOwnerName string, containerName string) []PodResult

	//DeleteEntityByHashKey to delete entity by hash key
	DeleteEntityByHashKey(hash uint64)
}

Motivation

image

Describe how to test/QA your changes

Local k8s test with a few dummy application

datadog:
  kubelet:
    tlsVerify: false
  env:
    - name: DD_AUTOSCALING_FAILOVER_ENABLED
      value: "true"
    - name: DD_AUTOSCALING_FAILOVER_METRICS
      value: "container.memory.usage container.cpu.usage"
Screenshot 2024-12-04 at 4 50 40 PM

Possible Drawbacks / Trade-offs

Additional Notes

@zhuminyi zhuminyi added team/containers team/container-platform The Container Platform Team labels Oct 28, 2024
@zhuminyi zhuminyi added this to the 7.61.0 milestone Oct 28, 2024
Copy link

cit-pr-commenter bot commented Oct 28, 2024

Go Package Import Differences

Baseline: 1cc7604
Comparison: adf5884

binaryosarchchange
cluster-agentlinuxamd64
+2, -0
+github.com/DataDog/datadog-agent/cmd/cluster-agent/api/v2/series
+github.com/DataDog/datadog-agent/pkg/clusteragent/autoscaling/workload/loadstore
cluster-agentlinuxarm64
+2, -0
+github.com/DataDog/datadog-agent/cmd/cluster-agent/api/v2/series
+github.com/DataDog/datadog-agent/pkg/clusteragent/autoscaling/workload/loadstore
cluster-agent-cloudfoundrylinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/cmd/cluster-agent/api/v2/series
cluster-agent-cloudfoundrylinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/cmd/cluster-agent/api/v2/series

Copy link

cit-pr-commenter bot commented Oct 28, 2024

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 59ddfb99-d73f-4135-b79a-df31256d230e

Baseline: 1cc7604
Comparison: adf5884
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
uds_dogstatsd_to_api_cpu % cpu utilization +0.73 [+0.06, +1.41] 1 Logs
quality_gate_idle memory utilization +0.61 [+0.57, +0.65] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization +0.36 [+0.28, +0.44] 1 Logs bounds checks dashboard
file_tree memory utilization +0.26 [+0.13, +0.38] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.22 [-0.59, +1.03] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.11 [-0.74, +0.96] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.08 [-0.80, +0.96] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.02 [-0.70, +0.74] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.00 [-0.83, +0.84] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.02] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.00 [-0.77, +0.77] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.02 [-0.13, +0.09] 1 Logs
quality_gate_logs % cpu utilization -0.03 [-3.25, +3.18] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.04 [-0.68, +0.60] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.06 [-0.52, +0.41] 1 Logs
tcp_syslog_to_blackhole ingress throughput -1.89 [-1.95, -1.83] 1 Logs

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency_http2 lost_bytes 9/10
quality_gate_idle memory_usage 9/10 bounds checks dashboard
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/10

Explanation

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

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

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".

CI Pass/Fail Decision

Failed. Some Quality Gates were violated.

  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 9/10 replicas passed. Failed 1 which is > 0. Gate FAILED.

@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 5 times, most recently from 036db95 to 9e892e3 Compare October 29, 2024 06:29
@github-actions github-actions bot added the long review PR is complex, plan time to review it label Oct 29, 2024
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch from 17f07d9 to 39e42be Compare October 29, 2024 14:53
@zhuminyi zhuminyi removed the long review PR is complex, plan time to review it label Oct 29, 2024
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Oct 29, 2024

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv aws.create-vm --pipeline-id=51870329 --os-family=ubuntu

Note: This applies to commit adf5884

@zhuminyi
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Oct 30, 2024

❌ MergeQueue

This PR is a draft

If you need support, contact us on Slack #devflow with those details!

@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch from 39e42be to 575aa9f Compare October 31, 2024 11:11
@github-actions github-actions bot added the long review PR is complex, plan time to review it label Oct 31, 2024
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 2 times, most recently from cfcf1aa to 3a1eed5 Compare November 4, 2024 19:26
@github-actions github-actions bot added medium review PR review might take time and removed long review PR is complex, plan time to review it labels Nov 4, 2024
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 2 times, most recently from ee354a8 to a0c2632 Compare November 19, 2024 04:37
@github-actions github-actions bot added long review PR is complex, plan time to review it and removed medium review PR review might take time labels Nov 19, 2024
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 3 times, most recently from 6fb29b9 to 2df46e1 Compare November 19, 2024 05:29
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 2 times, most recently from 9ff8aaf to c2a9d94 Compare December 4, 2024 21:29
@zhuminyi zhuminyi added the qa/rc-required Only for a PR that requires validation on the Release Candidate label Dec 4, 2024
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 2 times, most recently from 174f30d to 388809a Compare December 25, 2024 13:14
@zhuminyi zhuminyi modified the milestones: 7.62.0, 7.63.0 Dec 25, 2024
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 2 times, most recently from c500dc9 to 2ce2585 Compare December 25, 2024 17:10
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Dec 25, 2024

Uncompressed package size comparison

Comparison with ancestor 1cc7604f4b6b35a230b3dc1226d35b86034a832a

Diff per package
package diff status size ancestor threshold
datadog-agent-arm64-deb 0.02MB ⚠️ 935.43MB 935.40MB 140.00MB
datadog-agent-aarch64-rpm 0.02MB ⚠️ 944.72MB 944.70MB 140.00MB
datadog-heroku-agent-amd64-deb 0.00MB 505.29MB 505.28MB 70.00MB
datadog-iot-agent-x86_64-rpm 0.00MB 113.43MB 113.43MB 10.00MB
datadog-iot-agent-x86_64-suse 0.00MB 113.43MB 113.43MB 10.00MB
datadog-iot-agent-aarch64-rpm 0.00MB 108.89MB 108.89MB 10.00MB
datadog-dogstatsd-x86_64-rpm 0.00MB 78.64MB 78.64MB 10.00MB
datadog-dogstatsd-x86_64-suse 0.00MB 78.64MB 78.64MB 10.00MB
datadog-dogstatsd-amd64-deb 0.00MB 78.57MB 78.57MB 10.00MB
datadog-dogstatsd-arm64-deb 0.00MB 55.77MB 55.77MB 10.00MB
datadog-iot-agent-amd64-deb 0.00MB 113.36MB 113.36MB 10.00MB
datadog-iot-agent-arm64-deb 0.00MB 108.82MB 108.82MB 10.00MB
datadog-agent-x86_64-rpm -0.01MB 1200.42MB 1200.43MB 140.00MB
datadog-agent-x86_64-suse -0.01MB 1200.42MB 1200.43MB 140.00MB
datadog-agent-amd64-deb -0.01MB 1191.10MB 1191.11MB 140.00MB

Decision

⚠️ Warning

@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch 5 times, most recently from 3b6a97c to 1cc63cb Compare December 28, 2024 14:12
@zhuminyi zhuminyi force-pushed the cluster_agent_failover branch from 1cc63cb to adf5884 Compare December 28, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog long review PR is complex, plan time to review it qa/rc-required Only for a PR that requires validation on the Release Candidate team/container-platform The Container Platform Team team/containers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants