-
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 process agent status provider #22527
Conversation
Bloop Bleep... Dogbot HereRegression Detector ResultsRun ID: 3bedd8f6-a8a4-4f77-a92a-bc06a915a031 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 |
---|---|---|---|---|
➖ | idle | memory utilization | +0.02 | [-0.02, +0.05] |
➖ | file_to_blackhole | % cpu utilization | -0.44 | [-7.01, +6.14] |
➖ | file_tree | memory utilization | -1.00 | [-1.09, -0.92] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | process_agent_standard_check | memory utilization | +0.56 | [+0.49, +0.62] |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | +0.47 | [-0.99, +1.93] |
➖ | idle | memory utilization | +0.02 | [-0.02, +0.05] |
➖ | trace_agent_json | ingress throughput | +0.02 | [-0.01, +0.04] |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.06, +0.06] |
➖ | uds_dogstatsd_to_api | ingress throughput | -0.00 | [-0.03, +0.03] |
➖ | trace_agent_msgpack | ingress throughput | -0.00 | [-0.02, +0.01] |
➖ | tcp_syslog_to_blackhole | ingress throughput | -0.02 | [-0.08, +0.04] |
➖ | process_agent_standard_check_with_stats | memory utilization | -0.18 | [-0.23, -0.14] |
➖ | file_to_blackhole | % cpu utilization | -0.44 | [-7.01, +6.14] |
➖ | process_agent_real_time_mode | memory utilization | -0.54 | [-0.59, -0.50] |
➖ | file_tree | memory utilization | -1.00 | [-1.09, -0.92] |
➖ | otel_to_otel_logs | ingress throughput | -1.43 | [-2.16, -0.70] |
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".
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 think this should be QAed, so we should remove the qa/skip-qa label. But copying or linking to the QA instructions from your previous PR should be sufficient: Render agent status using status component #22115
-
This PR looks like it needs to be rebased as [e2e] skip process WindowsSuite #22517 was merged
addressPort, err := config.GetProcessAPIAddressPort() | ||
if err != nil { | ||
status["error"] = fmt.Sprintf("%v", err.Error()) | ||
return status | ||
} | ||
url = fmt.Sprintf("http://%s/agent/status", addressPort) |
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.
💭 thought
Wonder if you could mock the config.GetProcessAPIAddressPort
instead of setting the testServerURL
. I'd rather use an interface and mock it in test.
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.
That is a totally valid point. I would like to do that in a separate PR, as GetProcessAPIAddressPort
is used in multiple places and I don't want to change the focus of the fix in the PR 😄
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.
Oh I see config is global, ok then !
/trigger-ci |
🚂 Gitlab pipeline started Started pipeline #27696975 |
12bc6ed
to
3535cbe
Compare
@@ -209,7 +35,13 @@ func fakeStatusServer(t *testing.T, errCode int, response string) *httptest.Serv | |||
} | |||
|
|||
func TestStatus(t *testing.T) { | |||
server := fakeStatusServer(t, 200, jsonResponse) | |||
jsonBytes, err := fixturesTemplates.ReadFile("fixtures/json_response.tmpl") |
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.
💬 suggestion
You can directly embed the two files using
//go:embed fixtures/json_response.json
jsonResponse string // or []bytes if you prefer to have it in bytes
It saves you from an error checking and the double ReadFile
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.
Nice 😄
Thanks for the suggestion
/merge |
🚂 MergeQueue Pull request added to the queue. There are 3 builds ahead! (estimated merge in less than 1h) Use |
What does this PR do?
Fix the for the incident 24978
Make sure to write the status result to the correct map.
I added unit test to make sure we do not introduce a similar regression in the future.
Motivation
Additional Notes
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
PLEASE TAKE INTO CONSIDERATION THAT THE ORDER OF THE STATUS OUTPUT HAS CHANGED. When doing the QA, we need to focus on the same information being displayed and not too much on order.
Build the agent binary
invoke agent.build --build-exclude=systemd
Test that the agent status CLI command returns the right information.
agent status -j
agent status -p
agent status
agent status -v
The
agent status
displays information about other agent processes if they are running. For testing those permutations, you can build the other agent and run them + modify the agent configuration.To build and run the process agent, follow this guide
To build the APM agent, run:
inv -e trace-agent.build
. To run the apm agent./bin/trace-agent/trace-agent --config dev/dist/datadog.yaml
Here is an example of a configuration with logs, apm and process agent enabled:
Reviewer's Checklist
Triage
milestone is set.major_change
label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.changelog/no-changelog
label has been applied.qa/skip-qa
label, with required eitherqa/done
orqa/no-code-change
labels, are applied.team/..
label has been applied, indicating the team(s) that should QA this change.need-change/operator
andneed-change/helm
labels have been applied.k8s/<min-version>
label, indicating the lowest Kubernetes version compatible with this feature.