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
test/new-e2e/trace-agent: add basic e2e test #22261
Conversation
5d0c748
to
c821d3b
Compare
8de9039
to
c7e0c0d
Compare
Bloop Bleep... Dogbot HereRegression Detector ResultsRun ID: a64a1d10-6217-45be-b696-b8c464553a79 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.33 | [-0.38, -0.28] |
| ➖ | file_tree | memory utilization | -0.45 | [-0.55, -0.36] |
| ➖ | file_to_blackhole | % cpu utilization | -0.48 | [-7.03, +6.08] |
Fine details of change detection per experiment
| perf | experiment | goal | Δ mean % | Δ mean % CI |
|---|---|---|---|---|
| ➖ | process_agent_real_time_mode | memory utilization | +0.27 | [+0.23, +0.31] |
| ➖ | tcp_syslog_to_blackhole | ingress throughput | +0.13 | [+0.07, +0.20] |
| ➖ | trace_agent_msgpack | ingress throughput | +0.07 | [+0.05, +0.08] |
| ➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.03, +0.03] |
| ➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.00 | [-0.06, +0.06] |
| ➖ | trace_agent_json | ingress throughput | -0.05 | [-0.08, -0.02] |
| ➖ | process_agent_standard_check_with_stats | memory utilization | -0.10 | [-0.15, -0.05] |
| ➖ | idle | memory utilization | -0.33 | [-0.38, -0.28] |
| ➖ | file_tree | memory utilization | -0.45 | [-0.55, -0.36] |
| ➖ | process_agent_standard_check | memory utilization | -0.47 | [-0.52, -0.41] |
| ➖ | file_to_blackhole | % cpu utilization | -0.48 | [-7.03, +6.08] |
| ➖ | otel_to_otel_logs | ingress throughput | -0.63 | [-1.35, +0.08] |
| ➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -1.11 | [-2.55, +0.33] |
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.
Looks good, just added some comments!
Before merging, let's make sure all the tests pass locally since they're skipped on the CI currently.
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.
Overall looks good for our e2e tests, although I can't really comment too much on the changes to the components themselves (but I'm sure e2e team can look at those)
Just a few small change requests :)
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 refactoring of the existing tests 👏
2664fb0
to
e601dbc
Compare
| dockeragentparams.WithAgentServiceEnvVariable("STATSD_URL", pulumi.String("unix:///var/run/datadog/dsd.socket")), // Optional: UDS is more reliable for statsd metrics | ||
| ))), | ||
| e2e.WithProvisioner(awsdocker.Provisioner(opts...)), | ||
| e2e.WithStackName(fmt.Sprintf("apm-docker-suite-%s-%v", tr, os.Getenv("CI_PIPELINE_ID"))), |
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.
Added this because the default stack name caused a collision between test suites and errors in the CI
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.
You can fix this also by having one base suite and than one implementation per Test*, stack name use the suite name as an ID
test/new-e2e/tests/apm/vm_test.go
Outdated
| // TODO: Use the e2e context | ||
| c, err = v.Env().RemoteHost.DialRemotePort(context.Background(), port) |
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.
@vboulineau Not sure how to get the e2e.Context you mentioned. I don't see where I would get access to one anywhere, unless I need to hang on to a reference from the Init function.
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.
You'd need to add context.Context to e2e.Context - currently e2e.Context defines only a T() function to return a *testing.T instance.
The suite initialiser needs some changes too, as we need to create a context, probably at suite.init(). Then the function can be RemoteHost.DialRemotePort(port).
We can help with the implementation, but it looks like a bigger change than expected, so I suggest keeping your implementation and refactor it in a follow up, or wait for us to implement the change, or again open a new PR that introduces only the remoteHost.DialPort function.
| func WithDocker() ProvisionerOption { | ||
| return func(params *ProvisionerParams) error { | ||
| params.installDocker = true | ||
| return nil | ||
| } | ||
| } |
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
Having docker in an host environment prevents from having the docker client on the output environment struct. I'd rather use the awsdocker environment that has a docker client. The provider there takes care of defaulting to AMIs that have docker already installed, which saves some setup time. But we need a way to allow installing the agent on docker or on the host, so maybe it makes sense to use awshost for this goal.
One way to address the issue of extending default providers is to export the run function, so that you can call it from your custom provider with a custom env based on awshost. Would that work for you ?
| apm_config.enabled: true | ||
| apm_config.receiver_socket: /var/run/datadog/apm.socket |
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
Not a blocker, you can use embed to import it from a yaml file and leverage formatting
| dockeragentparams.WithAgentServiceEnvVariable("STATSD_URL", pulumi.String("unix:///var/run/datadog/dsd.socket")), // Optional: UDS is more reliable for statsd metrics | ||
| ))), | ||
| e2e.WithProvisioner(awsdocker.Provisioner(opts...)), | ||
| e2e.WithStackName(fmt.Sprintf("apm-docker-suite-%s-%v", tr, os.Getenv("CI_PIPELINE_ID"))), |
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.
You can fix this also by having one base suite and than one implementation per Test*, stack name use the suite name as an ID
|
/merge |
|
🚂 MergeQueue Pull request added to the queue. There are 2 builds ahead! (estimated merge in less than 47m) Use |
What does this PR do?
This PR adds a new, simple e2e test for the trace agent, generating some traces and checking that intake receives what we expect.
Motivation
This will serve as a basic check of the agent, as well as serving as a template for more complicated e2e tests.
Additional Notes
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
N/A
Reviewer's Checklist
Triagemilestone is set.major_changelabel 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-changeloglabel has been applied.qa/skip-qalabel, with required eitherqa/doneorqa/no-code-changelabels, are applied.team/..label has been applied, indicating the team(s) that should QA this change.need-change/operatorandneed-change/helmlabels have been applied.k8s/<min-version>label, indicating the lowest Kubernetes version compatible with this feature.