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

Feature parity between Python network check and Go network check #33190

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

rahulkaukuntla
Copy link
Contributor

@rahulkaukuntla rahulkaukuntla commented Jan 21, 2025

What does this PR do?

Adding features to the go (linux) network check that already exist in the python (linux) network check:

  • allowing for the configuration of the procfs_path to potentially be a path besides "/proc" (mimicked the logic from here)
  • adding general testing coverage to the netstatCounters method, and also collecting from the net/snmp file as well.
  • adding more TCP, IP, IPExt, UDP, and TCPExt metrics from the list of Python check metrics.
  • collecting various ethtool metrics and associated tags (driver name and version)
  • collecting conntrack metrics, from a configured conntrack executable, as well as from "nf_conntrack_" files in the ${procfs_path}/sys/net/netfiler directory.
  • requesting send and receive queue metrics for TCP from either ss or netstat
  • adding speed and mtu tags to interface metrics

A somewhat non-ideal side effect of this PR is that the network check now needs to make shell commands to get certain metrics:

  • conntrack metrics are found by calling sudo ${conntrackPath} -S
  • send and receive queue metrics for TCP is found by calling sh -c ss --numeric --tcp --all --ipv${ip version} or sh -c netstat -n -u -t -a if the ss executable couldn't be found.

Motivation

Describe how you validated your changes

I added unit tests, and manually ran the check with the new configuration options enabled to ensure that the expected metrics are being reported (using the output of the python check for cross-validation).

Possible Drawbacks / Trade-offs

Additional Notes

@bits-bot
Copy link
Collaborator

bits-bot commented Jan 21, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added team/platform-integrations short review PR is simple enough to be reviewed quickly labels Jan 21, 2025
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jan 21, 2025

Uncompressed package size comparison

Comparison with ancestor 79e5f056e9a0df792d51cb0069d410f37f1810d6

Diff per package
package diff status size ancestor threshold
datadog-heroku-agent-amd64-deb 0.11MB ⚠️ 440.78MB 440.67MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.05MB ⚠️ 62.22MB 62.17MB 0.50MB
datadog-iot-agent-x86_64-suse 0.05MB ⚠️ 62.22MB 62.17MB 0.50MB
datadog-iot-agent-amd64-deb 0.05MB ⚠️ 62.15MB 62.10MB 0.50MB
datadog-agent-x86_64-rpm 0.05MB ⚠️ 825.10MB 825.05MB 0.50MB
datadog-agent-x86_64-suse 0.05MB ⚠️ 825.10MB 825.05MB 0.50MB
datadog-agent-aarch64-rpm 0.05MB ⚠️ 816.03MB 815.99MB 0.50MB
datadog-agent-amd64-deb 0.05MB ⚠️ 815.30MB 815.25MB 0.50MB
datadog-agent-arm64-deb 0.05MB ⚠️ 806.26MB 806.21MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.05MB ⚠️ 59.46MB 59.41MB 0.50MB
datadog-iot-agent-arm64-deb 0.05MB ⚠️ 59.38MB 59.34MB 0.50MB
datadog-dogstatsd-amd64-deb 0.00MB 39.42MB 39.42MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.00MB 39.50MB 39.50MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.00MB 39.50MB 39.50MB 0.50MB
datadog-dogstatsd-arm64-deb 0.00MB 37.96MB 37.96MB 0.50MB

Decision

⚠️ Warning

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jan 21, 2025

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=57407729 --os-family=ubuntu

Note: This applies to commit a64afb9

@github-actions github-actions bot added medium review PR review might take time [deprecated] team/agent-shared-components Deprecated. Use team/agent-configuration or team/agent-runtimes labels instead. and removed short review PR is simple enough to be reviewed quickly labels Jan 22, 2025
@rahulkaukuntla rahulkaukuntla added the qa/done QA done before merge and regressions are covered by tests label Jan 22, 2025
Copy link

cit-pr-commenter bot commented Jan 27, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 1d8bc1e5-2dd3-426d-a00f-ed0ab088d5ed

Baseline: 79e5f05
Comparison: a64afb9
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
tcp_syslog_to_blackhole ingress throughput +1.16 [+1.10, +1.21] 1 Logs
quality_gate_idle memory utilization +0.40 [+0.36, +0.44] 1 Logs bounds checks dashboard
file_to_blackhole_1000ms_latency_linear_load egress throughput +0.23 [-0.24, +0.69] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.17 [-0.73, +1.07] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.15 [-0.63, +0.93] 1 Logs
quality_gate_idle_all_features memory utilization +0.14 [+0.09, +0.19] 1 Logs bounds checks dashboard
file_tree memory utilization +0.04 [-0.02, +0.10] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.04 [-0.75, +0.82] 1 Logs
file_to_blackhole_300ms_latency egress throughput +0.02 [-0.61, +0.64] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.01 [-0.78, +0.81] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.01 [-0.69, +0.71] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.00 [-0.73, +0.73] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.02, +0.01] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.30, +0.28] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.05 [-0.83, +0.73] 1 Logs
quality_gate_logs % cpu utilization -1.44 [-4.38, +1.50] 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_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 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 intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10
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

Passed. All Quality Gates passed.

  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 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 intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@github-actions github-actions bot removed the medium review PR review might take time label Jan 30, 2025
@github-actions github-actions bot added the long review PR is complex, plan time to review it label Jan 30, 2025
@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 Feb 3, 2025
Copy link

cit-pr-commenter bot commented Feb 3, 2025

Go Package Import Differences

Baseline: 79e5f05
Comparison: a64afb9

binaryosarchchange
agentlinuxamd64
+1, -0
+github.com/safchain/ethtool
agentlinuxarm64
+1, -0
+github.com/safchain/ethtool
iot-agentlinuxamd64
+1, -0
+github.com/safchain/ethtool
iot-agentlinuxarm64
+1, -0
+github.com/safchain/ethtool
heroku-agentlinuxamd64
+1, -0
+github.com/safchain/ethtool
cluster-agentlinuxamd64
+1, -0
+github.com/safchain/ethtool
cluster-agentlinuxarm64
+1, -0
+github.com/safchain/ethtool

@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 Feb 5, 2025
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 11, 2025

Static quality checks ✅

Please find below the results from static quality gates

Successful checks

Info

Result Quality gate On disk size On disk size limit On wire size On wire size limit
static_quality_gate_agent_deb_amd64 788.91MiB 801.8MiB 192.32MiB 202.62MiB
static_quality_gate_agent_deb_arm64 780.4MiB 793.14MiB 174.02MiB 184.51MiB
static_quality_gate_agent_rpm_amd64 788.96MiB 801.79MiB 194.33MiB 205.03MiB
static_quality_gate_agent_rpm_arm64 780.4MiB 793.09MiB 175.86MiB 186.44MiB
static_quality_gate_agent_suse_amd64 789.03MiB 801.81MiB 194.33MiB 205.03MiB
static_quality_gate_agent_suse_arm64 780.28MiB 793.14MiB 175.86MiB 186.44MiB
static_quality_gate_dogstatsd_deb_amd64 37.67MiB 47.67MiB 9.78MiB 19.78MiB
static_quality_gate_dogstatsd_deb_arm64 36.28MiB 46.27MiB 8.48MiB 18.49MiB
static_quality_gate_dogstatsd_rpm_amd64 37.67MiB 47.67MiB 9.79MiB 19.79MiB
static_quality_gate_dogstatsd_suse_amd64 37.67MiB 47.67MiB 9.79MiB 19.79MiB
static_quality_gate_iot_agent_deb_amd64 59.35MiB 69.0MiB 14.92MiB 24.8MiB
static_quality_gate_iot_agent_deb_arm64 56.71MiB 66.4MiB 12.86MiB 22.8MiB
static_quality_gate_iot_agent_rpm_amd64 59.35MiB 69.0MiB 14.94MiB 24.8MiB
static_quality_gate_iot_agent_rpm_arm64 56.71MiB 66.4MiB 12.88MiB 22.8MiB
static_quality_gate_iot_agent_suse_amd64 59.35MiB 69.0MiB 14.94MiB 24.8MiB
static_quality_gate_docker_agent_amd64 873.68MiB 886.12MiB 293.89MiB 304.21MiB
static_quality_gate_docker_agent_arm64 888.32MiB 900.79MiB 280.16MiB 290.47MiB
static_quality_gate_docker_agent_jmx_amd64 1.05GiB 1.06GiB 369.02MiB 379.33MiB
static_quality_gate_docker_agent_jmx_arm64 1.05GiB 1.06GiB 351.21MiB 361.55MiB
static_quality_gate_docker_dogstatsd_amd64 45.82MiB 55.78MiB 17.28MiB 27.28MiB
static_quality_gate_docker_dogstatsd_arm64 44.46MiB 54.45MiB 16.17MiB 26.16MiB
static_quality_gate_docker_cluster_agent_amd64 265.06MiB 274.78MiB 106.4MiB 116.28MiB
static_quality_gate_docker_cluster_agent_arm64 281.03MiB 290.82MiB 101.24MiB 111.12MiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[deprecated] team/agent-shared-components Deprecated. Use team/agent-configuration or team/agent-runtimes labels instead. long review PR is complex, plan time to review it qa/done QA done before merge and regressions are covered by tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants