-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ha-agent] Run HA enabled integrations only on leader agent #31186
Conversation
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=50072804 --os-family=ubuntu Note: This applies to commit f64da61 |
📥 📢 Info, this pull request increases the binary size of serverless extension by -8288 bytes. Each MB of binary size increase means about 10ms of additional cold start time, so this pull request would increase cold start time by 0ms. Debug infoIf you have questions, we are happy to help, come visit us in the #serverless slack channel and provide a link to this comment. We suggest you consider adding the |
Serverless Benchmark Results
tl;drUse these benchmarks as an insight tool during development.
What is this benchmarking?The The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type. How do I interpret these charts?The charts below comes from The benchstat docs explain how to interpret these charts.
I need more helpFirst off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development. If you would like a hand interpreting the results come chat with us in Benchmark stats
|
a9a00d1
to
5f3f483
Compare
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: 8f7cb53 Optimization Goals: ✅ No significant changes detected
|
perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
---|---|---|---|---|---|---|
➖ | tcp_syslog_to_blackhole | ingress throughput | +0.70 | [+0.64, +0.77] | 1 | Logs |
➖ | pycheck_lots_of_tags | % cpu utilization | +0.45 | [-2.95, +3.84] | 1 | Logs |
➖ | quality_gate_idle_all_features | memory utilization | +0.33 | [+0.23, +0.44] | 1 | Logs bounds checks dashboard |
➖ | otel_to_otel_logs | ingress throughput | +0.32 | [-0.38, +1.03] | 1 | Logs |
➖ | quality_gate_idle | memory utilization | +0.18 | [+0.13, +0.23] | 1 | Logs bounds checks dashboard |
➖ | file_to_blackhole_300ms_latency | egress throughput | +0.02 | [-0.61, +0.65] | 1 | Logs |
➖ | uds_dogstatsd_to_api | ingress throughput | +0.01 | [-0.10, +0.12] | 1 | Logs |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.01, +0.01] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency | egress throughput | -0.00 | [-0.78, +0.78] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency_linear_load | egress throughput | -0.01 | [-0.48, +0.46] | 1 | Logs |
➖ | file_to_blackhole_100ms_latency | egress throughput | -0.03 | [-0.76, +0.71] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency | egress throughput | -0.05 | [-0.87, +0.77] | 1 | Logs |
➖ | file_to_blackhole_500ms_latency | egress throughput | -0.07 | [-0.83, +0.70] | 1 | Logs |
➖ | file_tree | memory utilization | -0.12 | [-0.26, +0.01] | 1 | Logs |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -0.16 | [-0.88, +0.56] | 1 | Logs |
➖ | basic_py_check | % cpu utilization | -1.01 | [-4.87, +2.85] | 1 | Logs |
Bounds Checks: ✅ Passed
perf | experiment | bounds_check_name | replicates_passed | links |
---|---|---|---|---|
✅ | file_to_blackhole_0ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_0ms_latency | 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 | memory_usage | 10/10 | bounds checks dashboard |
✅ | quality_gate_idle_all_features | memory_usage | 10/10 | bounds checks dashboard |
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
CI Pass/Fail Decision
✅ Passed. All Quality Gates passed.
- quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
c222870
to
c40760a
Compare
5f3f483
to
b0213d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with a minor suggestion for style, thanks!
releasenotes/notes/NDMII-3154-ha-agent-collector-worker-22f3972469c669c3.yaml
Outdated
Show resolved
Hide resolved
…2469c669c3.yaml Co-authored-by: Jen Gilbert <j.h.gilbert@gmail.com>
comp/haagent/impl/haagent.go
Outdated
// When ha-agent is disabled, the agent behave as standalone agent (non HA) and will always run all integrations. | ||
func (h *haAgentImpl) ShouldRunIntegration(integrationName string) bool { | ||
if h.Enabled() { | ||
return validHaIntegrations[integrationName] && h.isLeader.Load() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this logic is correct: when I run the agent with DD_HA_AGENT_ENABLED=true
, the agent skips all checks:
2024-11-27 16:26:36 UTC | CORE | DEBUG | (pkg/collector/worker/check_logger.go:76 in Debug) | check:uptime | Check is an HA integration and current agent is not leader, skipping execution...
2024-11-27 16:26:36 UTC | CORE | DEBUG | (pkg/collector/worker/check_logger.go:76 in Debug) | check:ntp | Check is an HA integration and current agent is not leader, skipping execution...
2024-11-27 16:26:36 UTC | CORE | DEBUG | (pkg/collector/worker/check_logger.go:76 in Debug) | check:service_discovery | Check is an HA integration and current agent is not leader, skipping execution...
2024-11-27 16:26:37 UTC | CORE | DEBUG | (pkg/collector/worker/check_logger.go:76 in Debug) | check:memory | Check is an HA integration and current agent is not leader, skipping execution...
2024-11-27 16:26:38 UTC | CORE | DEBUG | (pkg/collector/worker/check_logger.go:76 in Debug) | check:io | Check is an HA integration and current agent is not leader, skipping execution...
Could you also please add a test that makes sure that non-HA checks continue to run when HA-agent is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vickenty thanks for catching that, it's fixed here f65d6d3 with updated tests.
looks like I introduced the bug when I moved move the logic from worker.go to haagent component: 5ed60bb#diff-fa837122b5056960e5f1bcbe5e6da5ed11701b8e75a2dff72681905d9a1e0314R225-R226
/merge |
Devflow running:
|
What does this PR do?
[ha-agent] Run agent integration only on leader agent
This PR changes a lot of files, but the actual change is only few lines located in pkg/collector/worker/worker.go:
https://github.com/DataDog/datadog-agent/pull/31186/files#diff-fa837122b5056960e5f1bcbe5e6da5ed11701b8e75a2dff72681905d9a1e0314R150-R234
the rest of the changes are only about injecting correctly the component.
Marked as
qa/rc-required
since it's a new feature that have impact on whether integrations skip or not.Motivation
Needed for HA Agent feature.
Describe how to test/QA your changes
1/ Run 2 Agents with HA Agent feature enabled:
2/ Write messages from backend to HA_AGENT RC product
4/ Check that only leader agent is running snmp integrations
Possible Drawbacks / Trade-offs
Additional Notes