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

Report TCP Failed Connections #25517

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

Report TCP Failed Connections #25517

wants to merge 4 commits into from

Conversation

akarpz
Copy link
Contributor

@akarpz akarpz commented May 10, 2024

What does this PR do?

Adds the capability to track TCP connection failure codes and send them in the payload (in conjunction with DataDog/agent-payload#301 and https://github.com/DataDog/dd-go/pull/134764). This feature is disabled by default and is in support of a demo at DASH. Afterwards this will be available via private (invite only) beta.

The overall structure of this code is unfortunately hampered by eBPF stack size constraints which prevent us from adding new fields to the connection stats object in kernelspace. As a result we have to "match" closed and failed connections in userspace which is flaky and some failures may be dropped. Upcoming work by the eBPF platform team (in-buffer batching) will relieve this constraint and this code can be refactored at that point to remove the matching logic and optimize the userspace code.

This was tested using the TCP load test which creates a lot of closed connections. By the nature of this test there are a significant amount of failures as well of varying types. Overall performance degraded slightly as expected, as we are storing more data and doing more business logic to match closed and failed connections.
adding graphs here shortly

This code has the capability to track any errno set in the skc_err field visible in tcp_done. With that said, we are filtering errors in userspace so the backend will only ever see connection Timeouts, Resets, and Refusals.

Motivation

https://datadoghq.atlassian.net/browse/NPM-3297

Additional Notes

Unit tests are currently broken and skipped. Ignore them for now please.

Order of Merge

  1. Payload change
  2. Agent change (this change)
  3. Backend change

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Copy link

cit-pr-commenter bot commented May 10, 2024

Go Package Import Differences

Baseline: 49f6e7f
Comparison: 4ab6587

binaryosarchchange
system-probelinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/pkg/network/tracer/connection/failure
system-probelinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/pkg/network/tracer/connection/failure

@akarpz akarpz added the qa/done Skip QA week as QA was done before merge and regressions are covered by tests label May 10, 2024
@akarpz akarpz added this to the 7.55.0 milestone May 10, 2024
@pr-commenter
Copy link

pr-commenter bot commented May 10, 2024

Test changes on VM

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

inv create-vm --pipeline-id=34373326 --os-family=ubuntu

@pr-commenter
Copy link

pr-commenter bot commented May 10, 2024

Regression Detector

Regression Detector Results

Run ID: 11248801-6d41-4085-9fea-c8f2b3a63b89
Baseline: 49f6e7f
Comparison: c3f7342

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 +29.86 [+23.71, +36.01]

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
file_to_blackhole % cpu utilization +29.86 [+23.71, +36.01]
tcp_syslog_to_blackhole ingress throughput +5.87 [-15.91, +27.65]
pycheck_1000_100byte_tags % cpu utilization +2.73 [-2.04, +7.50]
basic_py_check % cpu utilization +1.30 [-1.24, +3.85]
idle memory utilization +0.40 [+0.36, +0.43]
tcp_dd_logs_filter_exclude ingress throughput +0.01 [-0.03, +0.06]
uds_dogstatsd_to_api ingress throughput +0.01 [-0.20, +0.21]
trace_agent_msgpack ingress throughput +0.00 [-0.00, +0.00]
trace_agent_json ingress throughput +0.00 [-0.01, +0.01]
otel_to_otel_logs ingress throughput -0.15 [-0.53, +0.23]
uds_dogstatsd_to_api_cpu % cpu utilization -0.59 [-3.40, +2.22]
file_tree memory utilization -0.59 [-0.71, -0.47]

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

@akarpz akarpz marked this pull request as ready for review May 15, 2024 18:14
@akarpz akarpz requested review from a team as code owners May 15, 2024 18:14
@urseberry urseberry self-assigned this May 15, 2024
Copy link
Member

@brycekahle brycekahle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for ebpf-platform owned files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/system-probe qa/done Skip QA week as QA was done before merge and regressions are covered by tests team/networks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants