datadog-agent
datadog-agent copied to clipboard
[ASCII-1159] Migrate GUI to component implementation
What does this PR do?
This PR migrates the GUI implementation to the new GUI component. It currently live in the comp/core component bundle directory until a more relevant place is elected.
Motivation
Additional Notes
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
Regression Detector
Regression Detector Results
Run ID: 6d7e97ae-b337-47fd-af3e-0bbae5c32115 Baseline: 182707bae302fc0f03f8181a0d6390ad52c5ec54 Comparison: 115fda1b9614dcac9f786fe5596af423372a757c
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 | -1.22 | [-7.21, +4.78] |
Fine details of change detection per experiment
| perf | experiment | goal | Δ mean % | Δ mean % CI |
|---|---|---|---|---|
| ➖ | file_tree | memory utilization | +1.67 | [+1.56, +1.77] |
| ➖ | process_agent_real_time_mode | memory utilization | +0.50 | [+0.45, +0.55] |
| ➖ | pycheck_1000_100byte_tags | % cpu utilization | +0.36 | [-4.54, +5.27] |
| ➖ | idle | memory utilization | +0.29 | [+0.26, +0.33] |
| ➖ | basic_py_check | % cpu utilization | +0.29 | [-2.10, +2.68] |
| ➖ | tcp_syslog_to_blackhole | ingress throughput | +0.17 | [+0.07, +0.27] |
| ➖ | process_agent_standard_check_with_stats | memory utilization | +0.14 | [+0.08, +0.20] |
| ➖ | process_agent_standard_check | memory utilization | +0.05 | [-0.02, +0.12] |
| ➖ | trace_agent_json | ingress throughput | +0.00 | [-0.02, +0.02] |
| ➖ | uds_dogstatsd_to_api | ingress throughput | -0.00 | [-0.20, +0.20] |
| ➖ | trace_agent_msgpack | ingress throughput | -0.01 | [-0.01, -0.00] |
| ➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.03 | [-0.07, +0.01] |
| ➖ | otel_to_otel_logs | ingress throughput | -0.25 | [-0.67, +0.18] |
| ➖ | file_to_blackhole | % cpu utilization | -1.22 | [-7.21, +4.78] |
| ➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -1.40 | [-4.35, +1.56] |
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".
Go Package Import Differences
Baseline: 182707bae302fc0f03f8181a0d6390ad52c5ec54 Comparison: 115fda1b9614dcac9f786fe5596af423372a757c
| binary | os | arch | change |
|---|---|---|---|
| agent | linux | amd64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| agent | linux | arm64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| agent | windows | amd64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| agent | windows | 386 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| agent | darwin | amd64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| agent | darwin | arm64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| iot-agent | linux | amd64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| iot-agent | linux | arm64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| heroku-agent | linux | amd64 | +2, -1
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
+github.com/DataDog/datadog-agent/comp/core/gui/guiimpl
|
| cluster-agent | linux | amd64 | +1, -2
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
-github.com/cyphar/filepath-securejoin
|
| cluster-agent | linux | arm64 | +1, -2
-github.com/DataDog/datadog-agent/cmd/agent/gui
+github.com/DataDog/datadog-agent/comp/core/gui
-github.com/cyphar/filepath-securejoin
|
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=31535242 --os-family=ubuntu
Great work 🎉
I left some comments. I f you have any doubts let me know
Sorry about closing and opening again the PR, I miss calculated my keyboard-fu
@misteriaud
The PR looks fantastic 🎉
Have you tried removing or modifying the code so we do not have to register the /gui/csrf-token route? https://github.com/DataDog/datadog-agent/blob/b95b5af23d134f06c3f499f2c803175dbd4d0562/comp/api/api/apiimpl/internal/agent/agent.go#L102 It seems that there is a weird dependency going on since the GUI generates the token, so there is no need to pass it around. Also, the authToken is not used in the validate handler from the GUI server. https://github.com/DataDog/datadog-agent/pull/23791/files#diff-fd1713aa07a9745a76f6a6c2790439c3a107807a804ce4b5e7130034571f4b60R213 We might be able to remove those old pieces of code, and then we would no longer have to declare the GUI as a dependency of the API component. Which would mean we do not have to use Optional :smile:
/merge
:steam_locomotive: MergeQueue
Pull request added to the queue.
This build is next! (estimated merge in less than 23m)
Use /merge -c to cancel this operation!