-
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
Fix ECS Fargate processes not being associated with containers #24186
Fix ECS Fargate processes not being associated with containers #24186
Conversation
[Fast Unit Tests Report] On pipeline 31024874 (CI Visibility). The following jobs did not run any unit tests: Jobs:
If you modified Go files and expected unit tests to run in these jobs, please double check the job logs. If you think tests should have been executed reach out to #agent-developer-experience |
pkg/util/cgroups/pid_mapper_test.go
Outdated
@@ -216,6 +228,11 @@ func TestIdentiferFromCgroupReferences(t *testing.T) { | |||
fileContent: ecsFargateCgroup, | |||
expectedID: "8474ac4cec7a4f488834b00591271ec3-3054012820", | |||
}, | |||
{ | |||
name: "ecs fargate shorter", | |||
fileContent: ecsFargateCgroup, |
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.
fileContent: ecsFargateCgroup, | |
fileContent: ecsFargateCgroupShort, |
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.
Yup, just noticed failing jobs, my bad
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.
Looks good!
/merge |
🚂 MergeQueue This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Use |
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=31024874 --os-family=ubuntu |
🚂 MergeQueue Added to the queue. This build is next! (estimated merge in less than 28m) Use |
Regression DetectorRegression Detector ResultsRun ID: 33621e2d-713c-433c-b195-a22da630ebbb Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | file_to_blackhole | % cpu utilization | +3.12 | [-3.23, +9.47] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | file_to_blackhole | % cpu utilization | +3.12 | [-3.23, +9.47] |
➖ | pycheck_1000_100byte_tags | % cpu utilization | +2.09 | [-2.84, +7.01] |
➖ | tcp_syslog_to_blackhole | ingress throughput | +2.07 | [+1.98, +2.16] |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | +1.82 | [-1.06, +4.70] |
➖ | basic_py_check | % cpu utilization | +0.65 | [-1.78, +3.08] |
➖ | process_agent_real_time_mode | memory utilization | +0.51 | [+0.47, +0.55] |
➖ | idle | memory utilization | +0.42 | [+0.38, +0.45] |
➖ | process_agent_standard_check_with_stats | memory utilization | +0.25 | [+0.21, +0.29] |
➖ | otel_to_otel_logs | ingress throughput | +0.04 | [-0.38, +0.45] |
➖ | trace_agent_json | ingress throughput | +0.02 | [-0.02, +0.05] |
➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.20, +0.20] |
➖ | trace_agent_msgpack | ingress throughput | -0.00 | [-0.02, +0.02] |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.01 | [-0.05, +0.03] |
➖ | process_agent_standard_check | memory utilization | -0.13 | [-0.18, -0.09] |
➖ | file_tree | memory utilization | -0.16 | [-0.25, -0.08] |
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:
-
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".
* Fix PID parsing in ECS Fargate * Add changelog * Fix broken unit test * Update ECS CID regex to be less restrictive
* Fix PID parsing in ECS Fargate * Add changelog * Fix broken unit test * Update ECS CID regex to be less restrictive
* Fix PID parsing in ECS Fargate * Add changelog * Fix broken unit test * Update ECS CID regex to be less restrictive
* Fix PID parsing in ECS Fargate * Add changelog * Fix broken unit test * Update ECS CID regex to be less restrictive
What does this PR do?
Fixes a bug where sometimes the process data generated for an ECS Fargate container is missing the container tags
Motivation
https://datadoghq.atlassian.net/browse/CONS-6242
Additional Notes
It appears that the problem was due to regex parsing, while debugging I found instances where the fargate container ID was {32}-{9}, but we were explicitly only looking at {32}-{10}. I cannot find any information on the definition of the fargate container ID format, so while this addresses the situation we came across in the support ticket, I do not know if there are other cases we have not run into yet.
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
I was able to reliably replicate this issue using the python container using the following task container definition:
Add this container definition as another container here, after the redis container definition, and deploy to an ECS fargate cluster
Verify that the container shows up on the live containers page, and that the process data shows up attached to this container, like so:
Also, to make sure the original bug that we ran into was being hit, log into the AWS console and navigate to the tasks page for you cluster, find the task that contains the python container, and validate that the container runtime ID matches the format that caused the issue in the first place:
The above container reliably triggered the issue, across multiple clusters. However, if it does not result in a container ID that is one character short, then it is worth noting that the QA for this has already been done in a cluster where we were able to reproduce the issue, and has been validated