-
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
[SVLS-4142] Create a Lambda span on timeouts #21481
Conversation
Bloop Bleep... Dogbot HereRegression Detector ResultsRun ID: 8d0956f7-62bf-4081-b5a1-e8c249864159 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 | +0.11 | [-6.41, +6.64] |
➖ | idle | memory utilization | +0.09 | [+0.06, +0.12] |
➖ | file_tree | memory utilization | +0.09 | [-0.03, +0.20] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | otel_to_otel_logs | ingress throughput | +1.26 | [+0.53, +2.00] |
➖ | file_to_blackhole | % cpu utilization | +0.11 | [-6.41, +6.64] |
➖ | process_agent_real_time_mode | memory utilization | +0.10 | [+0.06, +0.13] |
➖ | idle | memory utilization | +0.09 | [+0.06, +0.12] |
➖ | file_tree | memory utilization | +0.09 | [-0.03, +0.20] |
➖ | process_agent_standard_check_with_stats | memory utilization | +0.04 | [-0.00, +0.09] |
➖ | 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_json | ingress throughput | -0.02 | [-0.04, +0.01] |
➖ | trace_agent_msgpack | ingress throughput | -0.02 | [-0.03, -0.01] |
➖ | process_agent_standard_check | memory utilization | -0.10 | [-0.15, -0.04] |
➖ | tcp_syslog_to_blackhole | ingress throughput | -0.15 | [-0.21, -0.09] |
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".
pkg/serverless/daemon/routes.go
Outdated
@@ -86,6 +89,7 @@ type EndInvocation struct { | |||
|
|||
func (e *EndInvocation) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |||
log.Debug("Hit on the serverless.EndInvocation route.") | |||
e.daemon.SetExecutionSpanComplete(true) |
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'd suggest doing this as a defer instead. Or at least right right after we actually complete the span.
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.
Hmm, actually, this takes some careful thought. I think this is actually the correct thing to do. No defer.
If end-invocation has been called, even if it is not done, we do not want to also call it a second time on impending timeout. That could potentially lead to two invocation spans.
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=31682128 --os-family=ubuntu |
Regression DetectorRegression Detector ResultsRun ID: 4a3399e3-d6bf-4b30-ae19-c8d3529ee7c6 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 | -1.16 | [-7.31, +4.98] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | pycheck_1000_100byte_tags | % cpu utilization | +1.73 | [-3.20, +6.66] |
➖ | file_tree | memory utilization | +0.45 | [+0.34, +0.56] |
➖ | tcp_syslog_to_blackhole | ingress throughput | +0.45 | [+0.36, +0.54] |
➖ | idle | memory utilization | +0.30 | [+0.25, +0.34] |
➖ | basic_py_check | % cpu utilization | +0.13 | [-2.32, +2.58] |
➖ | process_agent_standard_check | memory utilization | +0.04 | [-0.02, +0.11] |
➖ | trace_agent_json | ingress throughput | +0.01 | [-0.03, +0.04] |
➖ | otel_to_otel_logs | ingress throughput | -0.00 | [-0.43, +0.43] |
➖ | trace_agent_msgpack | ingress throughput | -0.00 | [-0.00, +0.00] |
➖ | uds_dogstatsd_to_api | ingress throughput | -0.00 | [-0.21, +0.20] |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.04 | [-0.07, -0.01] |
➖ | process_agent_standard_check_with_stats | memory utilization | -0.19 | [-0.24, -0.13] |
➖ | process_agent_real_time_mode | memory utilization | -0.26 | [-0.30, -0.21] |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -0.90 | [-3.73, +1.93] |
➖ | file_to_blackhole | % cpu utilization | -1.16 | [-7.31, +4.98] |
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".
h.daemon.LambdaLibraryStateLock.Lock() | ||
defer h.daemon.LambdaLibraryStateLock.Unlock() |
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.
Re: timeout spans for NodeJS -> updated this to ignore when the /hello
route is hit. Instead, Daemon.executionSpanIncomplete
is false
when unset, and is only changed to true
when the /startInvocation
route is hit.
Now the Impending Timeout
span in NodeJS should only be created by the Node Lambda Layer
Co-authored-by: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com>
Serverless Benchmark Results
tl;dr
What is this benchmarking?The The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type. How do I interpret these charts?The charts below comes from The benchstat docs explain how to interpret these charts.
Benchmark stats
|
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.
LGTM!
/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 |
🚂 MergeQueue Pull request added to the queue. This build is going to start soon! (estimated merge in less than 24m) Use |
sister PR: #22202 |
* create a Lambda span on timeouts * don't create a cold start span when the runtime restarts during timeouts * fix linting * fix test * lint: rename name variables * lint again * small fixes * refactor timeout span logic * add mutexes * fix span completed check * revert refactor * remove cold start span changes * use mutex over rwmutex * test routes * add comment + update tests * test endExecutionSpan * add serverless.go test * add test /hello for route * only set span incomplete when /startInvocation has been hit * time out -> timeout Co-authored-by: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> --------- Co-authored-by: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com>
* create a Lambda span on timeouts * don't create a cold start span when the runtime restarts during timeouts * fix linting * fix test * lint: rename name variables * lint again * small fixes * refactor timeout span logic * add mutexes * fix span completed check * revert refactor * remove cold start span changes * use mutex over rwmutex * test routes * add comment + update tests * test endExecutionSpan * add serverless.go test * add test /hello for route * only set span incomplete when /startInvocation has been hit * time out -> timeout Co-authored-by: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> --------- Co-authored-by: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com>
What does this PR do?
This is specific to universal instrumentation (runtimes: Java, .NET, Go). Modifies
OnInvokeEnd
to handle a timeouts and create theaws.lambda
span in the Extension.Motivation
The Lambda extension requires requests to be made to its
startInvocation
andendInvocation
endpoints by the tracer in order to complete anaws.lambda
span. Typically during a timeout invocation, we only receive a request tostartInvocation
because the Lambda times out before the tracer can make a request toendInvocation
with the tracer-generated trace ID, span ID and sampling priority.This change has the Extension create the trace ID, span ID and sampling priority itself since it can't rely on the tracer sending that information. The Extension already keeps a record of how much time is left (
deadlineMs
), so we're able to finish the execution span and flush it before the timeout.Additional Notes
Possible Drawbacks / Trade-offs
On caveat of this method that we've discussed (but haven't solved) is the following case:
Describe how to test/QA your changes
Manual testing + RC, coupled with multiple unit tests
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 is not 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.