Skip to content
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

Add tmp_free enhanced lambda metric #32927

Closed
wants to merge 4 commits into from

Conversation

shreyamalpani
Copy link
Contributor

What does this PR do?

Adds the aws.lambda.enhanced.tmp_free enhanced metric representing bytes available in /tmp.

Motivation

This metric was added in the new bottlecap extension as AWS Lambda Insights reports this metric.

Describe how you validated your changes

Possible Drawbacks / Trade-offs

Additional Notes

@github-actions github-actions bot added the short review PR is simple enough to be reviewed quickly label Jan 13, 2025
@shreyamalpani shreyamalpani added team/serverless qa/done QA done before merge and regressions are covered by tests changelog/no-changelog labels Jan 13, 2025
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jan 13, 2025

Uncompressed package size comparison

Comparison with ancestor 17d25f22437ba16171e2ed897e7f88f125c04e5a

Diff per package
package diff status size ancestor threshold
datadog-agent-amd64-deb 0.00MB 1004.81MB 1004.81MB 0.50MB
datadog-agent-x86_64-rpm 0.00MB 1014.48MB 1014.48MB 0.50MB
datadog-agent-x86_64-suse 0.00MB 1014.48MB 1014.48MB 0.50MB
datadog-agent-arm64-deb 0.00MB 988.77MB 988.77MB 0.50MB
datadog-agent-aarch64-rpm 0.00MB 998.42MB 998.42MB 0.50MB
datadog-dogstatsd-amd64-deb 0.00MB 58.83MB 58.83MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.00MB 58.90MB 58.90MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.00MB 58.90MB 58.90MB 0.50MB
datadog-dogstatsd-arm64-deb 0.00MB 56.33MB 56.33MB 0.50MB
datadog-heroku-agent-amd64-deb 0.00MB 532.56MB 532.56MB 0.50MB
datadog-iot-agent-amd64-deb 0.00MB 93.86MB 93.86MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.00MB 93.93MB 93.93MB 0.50MB
datadog-iot-agent-x86_64-suse 0.00MB 93.92MB 93.92MB 0.50MB
datadog-iot-agent-arm64-deb 0.00MB 89.91MB 89.91MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.00MB 89.98MB 89.98MB 0.50MB

Decision

✅ Passed

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jan 13, 2025

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv aws.create-vm --pipeline-id=52888756 --os-family=ubuntu

Note: This applies to commit 833d2b6

Copy link

cit-pr-commenter bot commented Jan 13, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 6fd8effc-d82f-4184-952a-a9246a4134a4

Baseline: 17d25f2
Comparison: 833d2b6
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
uds_dogstatsd_to_api_cpu % cpu utilization +0.73 [+0.02, +1.44] 1 Logs
file_tree memory utilization +0.51 [+0.37, +0.64] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.02 [-0.87, +0.91] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.01 [-0.83, +0.84] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.00 [-0.89, +0.89] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.10, +0.10] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.00 [-0.79, +0.78] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.01 [-0.65, +0.63] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.02 [-0.76, +0.73] 1 Logs
tcp_syslog_to_blackhole ingress throughput -0.04 [-0.10, +0.02] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.22 [-0.70, +0.26] 1 Logs
quality_gate_idle memory utilization -0.22 [-0.25, -0.19] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization -0.32 [-0.40, -0.24] 1 Logs bounds checks dashboard
file_to_blackhole_1000ms_latency egress throughput -0.38 [-1.15, +0.40] 1 Logs
quality_gate_logs % cpu utilization -1.01 [-4.18, +2.16] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/10

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

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

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:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. 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.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.

@github-actions github-actions bot added long review PR is complex, plan time to review it and removed short review PR is simple enough to be reviewed quickly labels Jan 13, 2025
Copy link
Contributor

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between 17d25f2 and 7cb9f33.

tl;dr

Use these benchmarks as an insight tool during development.

  1. Skim down the vs base column in each chart. If there is a ~, then there was no statistically significant change to the benchmark. Otherwise, ensure the estimated percent change is either negative or very small.

  2. The last row of each chart is the geomean. Ensure this percentage is either negative or very small.

What is this benchmarking?

The BenchmarkStartEndInvocation compares the amount of time it takes to call the start-invocation and end-invocation endpoints. For universal instrumentation languages (Dotnet, Golang, Java, Ruby), this represents the majority of the duration overhead added by our tracing layer.

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 benchstat. They represent the statistical change in duration (sec/op), memory overhead (B/op), and allocations (allocs/op).

The benchstat docs explain how to interpret these charts.

Before the comparison table, we see common file-level configuration. If there are benchmarks with different configuration (for example, from different packages), benchstat will print separate tables for each configuration.

The table then compares the two input files for each benchmark. It shows the median and 95% confidence interval summaries for each benchmark before and after the change, and an A/B comparison under "vs base". ... The p-value measures how likely it is that any differences were due to random chance (i.e., noise). The "~" means benchstat did not detect a statistically significant difference between the two inputs. ...

Note that "statistically significant" is not the same as "large": with enough low-noise data, even very small changes can be distinguished from noise and considered statistically significant. It is, of course, generally easier to distinguish large changes from noise.

Finally, the last row of the table shows the geometric mean of each column, giving an overall picture of how the benchmarks changed. Proportional changes in the geomean reflect proportional changes in the benchmarks. For example, given n benchmarks, if sec/op for one of them increases by a factor of 2, then the sec/op geomean will increase by a factor of ⁿ√2.

I need more help

First off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development.

If you would like a hand interpreting the results come chat with us in #serverless-agent in the internal DataDog slack or in #serverless in the public DataDog slack. We're happy to help!

Benchmark stats
goos: linux
goarch: amd64
pkg: github.com/DataDog/datadog-agent/pkg/serverless/daemon
cpu: AMD EPYC 7763 64-Core Processor                
                                      │ baseline/benchmark.log │       current/benchmark.log        │
                                      │         sec/op         │   sec/op     vs base               │
api-gateway-appsec.json                            86.27µ ± 7%   87.92µ ± 7%       ~ (p=0.052 n=10)
api-gateway-kong-appsec.json                       67.65µ ± 4%   67.55µ ± 1%       ~ (p=0.481 n=10)
api-gateway-kong.json                              65.43µ ± 1%   64.35µ ± 1%  -1.64% (p=0.004 n=10)
api-gateway-non-proxy-async.json                   101.6µ ± 0%   103.8µ ± 3%       ~ (p=0.075 n=10)
api-gateway-non-proxy.json                         100.5µ ± 1%   104.8µ ± 3%  +4.29% (p=0.000 n=10)
api-gateway-websocket-connect.json                 65.30µ ± 2%   67.68µ ± 4%  +3.64% (p=0.004 n=10)
api-gateway-websocket-default.json                 58.92µ ± 3%   60.39µ ± 3%  +2.49% (p=0.007 n=10)
api-gateway-websocket-disconnect.json              58.70µ ± 1%   59.49µ ± 2%  +1.34% (p=0.029 n=10)
api-gateway.json                                   108.9µ ± 1%   109.9µ ± 3%       ~ (p=0.075 n=10)
application-load-balancer.json                     58.65µ ± 2%   59.60µ ± 1%  +1.61% (p=0.003 n=10)
cloudfront.json                                    44.63µ ± 1%   45.77µ ± 2%  +2.55% (p=0.004 n=10)
cloudwatch-events.json                             37.47µ ± 1%   38.42µ ± 2%  +2.54% (p=0.000 n=10)
cloudwatch-logs.json                               60.45µ ± 1%   62.71µ ± 2%  +3.74% (p=0.000 n=10)
custom.json                                        31.41µ ± 2%   31.82µ ± 1%  +1.30% (p=0.019 n=10)
dynamodb.json                                      85.27µ ± 1%   87.00µ ± 1%  +2.03% (p=0.000 n=10)
empty.json                                         29.96µ ± 1%   30.24µ ± 1%  +0.92% (p=0.002 n=10)
eventbridge-custom.json                            46.03µ ± 1%   46.73µ ± 1%  +1.52% (p=0.009 n=10)
eventbridge-no-bus.json                            45.45µ ± 1%   45.44µ ± 1%       ~ (p=0.739 n=10)
eventbridge-no-timestamp.json                      45.12µ ± 1%   44.62µ ± 3%       ~ (p=0.075 n=10)
eventbridgesns.json                                59.45µ ± 1%   59.42µ ± 1%       ~ (p=0.796 n=10)
eventbridgesqs.json                                65.89µ ± 1%   65.49µ ± 2%       ~ (p=0.105 n=10)
http-api.json                                      65.57µ ± 1%   65.31µ ± 1%       ~ (p=0.353 n=10)
kinesis-batch.json                                 65.93µ ± 1%   65.32µ ± 1%       ~ (p=0.089 n=10)
kinesis.json                                       52.80µ ± 1%   52.27µ ± 1%  -1.01% (p=0.015 n=10)
s3.json                                            56.24µ ± 1%   56.06µ ± 1%       ~ (p=0.225 n=10)
sns-batch.json                                     83.51µ ± 1%   81.65µ ± 1%  -2.23% (p=0.000 n=10)
sns.json                                           63.53µ ± 2%   62.43µ ± 2%  -1.74% (p=0.007 n=10)
snssqs.json                                        105.2µ ± 1%   103.8µ ± 1%  -1.33% (p=0.015 n=10)
snssqs_no_dd_context.json                          95.87µ ± 2%   95.96µ ± 1%       ~ (p=0.631 n=10)
sqs-aws-header.json                                53.35µ ± 1%   52.87µ ± 2%       ~ (p=0.247 n=10)
sqs-batch.json                                     86.47µ ± 1%   86.16µ ± 1%       ~ (p=0.796 n=10)
sqs.json                                           64.35µ ± 1%   65.17µ ± 2%       ~ (p=0.063 n=10)
sqs_no_dd_context.json                             59.24µ ± 1%   59.60µ ± 1%       ~ (p=0.075 n=10)
stepfunction.json                                  41.27µ ± 1%   40.92µ ± 2%       ~ (p=0.109 n=10)
geomean                                            61.93µ        62.31µ       +0.61%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │          B/op          │     B/op      vs base               │
api-gateway-appsec.json                           37.31Ki ± 0%   37.31Ki ± 0%       ~ (p=0.403 n=10)
api-gateway-kong-appsec.json                      26.89Ki ± 0%   26.89Ki ± 0%       ~ (p=0.991 n=10)
api-gateway-kong.json                             24.35Ki ± 0%   24.35Ki ± 0%       ~ (p=0.835 n=10)
api-gateway-non-proxy-async.json                  47.97Ki ± 0%   47.98Ki ± 0%  +0.01% (p=0.035 n=10)
api-gateway-non-proxy.json                        47.15Ki ± 0%   47.15Ki ± 0%       ~ (p=0.541 n=10)
api-gateway-websocket-connect.json                25.35Ki ± 0%   25.35Ki ± 0%       ~ (p=0.697 n=10)
api-gateway-websocket-default.json                21.24Ki ± 0%   21.24Ki ± 0%       ~ (p=0.889 n=10)
api-gateway-websocket-disconnect.json             21.00Ki ± 0%   21.00Ki ± 0%       ~ (p=0.563 n=10)
api-gateway.json                                  49.25Ki ± 0%   49.25Ki ± 0%       ~ (p=0.617 n=10)
application-load-balancer.json                    23.37Ki ± 0%   23.37Ki ± 0%  -0.01% (p=0.016 n=10)
cloudfront.json                                   17.43Ki ± 0%   17.43Ki ± 0%       ~ (p=0.773 n=10)
cloudwatch-events.json                            11.50Ki ± 0%   11.50Ki ± 0%       ~ (p=0.350 n=10)
cloudwatch-logs.json                              53.03Ki ± 0%   53.03Ki ± 0%       ~ (p=0.268 n=10)
custom.json                                       9.526Ki ± 0%   9.525Ki ± 0%       ~ (p=0.077 n=10)
dynamodb.json                                     40.31Ki ± 0%   40.30Ki ± 0%       ~ (p=0.114 n=10)
empty.json                                        9.063Ki ± 0%   9.062Ki ± 0%       ~ (p=0.675 n=10)
eventbridge-custom.json                           14.64Ki ± 0%   14.64Ki ± 0%       ~ (p=0.983 n=10)
eventbridge-no-bus.json                           13.61Ki ± 0%   13.61Ki ± 0%       ~ (p=0.573 n=10)
eventbridge-no-timestamp.json                     13.61Ki ± 0%   13.61Ki ± 0%  +0.01% (p=0.046 n=10)
eventbridgesns.json                               20.45Ki ± 0%   20.45Ki ± 0%       ~ (p=0.465 n=10)
eventbridgesqs.json                               24.59Ki ± 0%   24.58Ki ± 0%       ~ (p=0.082 n=10)
http-api.json                                     23.28Ki ± 0%   23.29Ki ± 0%       ~ (p=0.400 n=10)
kinesis-batch.json                                26.50Ki ± 0%   26.50Ki ± 0%       ~ (p=0.118 n=10)
kinesis.json                                      17.38Ki ± 0%   17.38Ki ± 0%       ~ (p=0.565 n=10)
s3.json                                           19.88Ki ± 0%   19.88Ki ± 0%       ~ (p=0.556 n=10)
sns-batch.json                                    39.04Ki ± 0%   39.04Ki ± 0%       ~ (p=0.514 n=10)
sns.json                                          24.46Ki ± 0%   24.46Ki ± 0%       ~ (p=0.243 n=10)
snssqs.json                                       52.72Ki ± 0%   52.72Ki ± 0%       ~ (p=1.000 n=10)
snssqs_no_dd_context.json                         46.48Ki ± 0%   46.48Ki ± 0%       ~ (p=0.839 n=10)
sqs-aws-header.json                               18.75Ki ± 0%   18.75Ki ± 0%       ~ (p=0.564 n=10)
sqs-batch.json                                    41.23Ki ± 0%   41.23Ki ± 0%       ~ (p=0.193 n=10)
sqs.json                                          25.36Ki ± 0%   25.36Ki ± 0%       ~ (p=0.868 n=10)
sqs_no_dd_context.json                            21.01Ki ± 0%   21.01Ki ± 0%       ~ (p=0.617 n=10)
stepfunction.json                                 13.51Ki ± 0%   13.51Ki ± 0%       ~ (p=0.832 n=10)
geomean                                           24.12Ki        24.12Ki       -0.00%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │       allocs/op        │ allocs/op   vs base                 │
api-gateway-appsec.json                             627.0 ± 0%   627.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-kong-appsec.json                        485.0 ± 0%   485.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-kong.json                               463.0 ± 0%   463.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-non-proxy-async.json                    720.0 ± 0%   720.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-non-proxy.json                          710.0 ± 0%   710.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-connect.json                  448.0 ± 0%   448.0 ± 0%       ~ (p=0.474 n=10)
api-gateway-websocket-default.json                  373.0 ± 0%   373.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-disconnect.json               363.0 ± 0%   363.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway.json                                    782.0 ± 0%   782.0 ± 0%       ~ (p=1.000 n=10) ¹
application-load-balancer.json                      348.0 ± 0%   348.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudfront.json                                     278.0 ± 0%   278.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudwatch-events.json                              215.0 ± 0%   215.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudwatch-logs.json                                208.0 ± 0%   208.0 ± 0%       ~ (p=1.000 n=10) ¹
custom.json                                         163.0 ± 0%   163.0 ± 0%       ~ (p=1.000 n=10) ¹
dynamodb.json                                       579.0 ± 0%   579.0 ± 0%       ~ (p=1.000 n=10) ¹
empty.json                                          154.0 ± 0%   154.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridge-custom.json                             258.0 ± 0%   258.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridge-no-bus.json                             249.0 ± 0%   249.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridge-no-timestamp.json                       249.0 ± 0%   249.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridgesns.json                                 315.0 ± 0%   315.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridgesqs.json                                 355.0 ± 0%   355.0 ± 0%       ~ (p=1.000 n=10) ¹
http-api.json                                       421.0 ± 0%   421.0 ± 0%       ~ (p=1.000 n=10) ¹
kinesis-batch.json                                  380.0 ± 0%   380.0 ± 0%       ~ (p=1.000 n=10) ¹
kinesis.json                                        276.0 ± 0%   276.0 ± 0%       ~ (p=1.000 n=10) ¹
s3.json                                             348.0 ± 0%   348.0 ± 0%       ~ (p=1.000 n=10) ¹
sns-batch.json                                      462.0 ± 0%   462.0 ± 0%       ~ (p=1.000 n=10) ¹
sns.json                                            333.0 ± 0%   333.0 ± 0%       ~ (p=1.000 n=10) ¹
snssqs.json                                         457.0 ± 0%   457.0 ± 0%       ~ (p=1.000 n=10) ¹
snssqs_no_dd_context.json                           417.0 ± 0%   417.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs-aws-header.json                                 273.0 ± 0%   273.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs-batch.json                                      497.0 ± 0%   497.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs.json                                            348.0 ± 0%   348.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs_no_dd_context.json                              334.0 ± 0%   334.0 ± 0%       ~ (p=1.000 n=10) ¹
stepfunction.json                                   223.0 ± 0%   223.0 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                             356.8        356.8       +0.00%
¹ all samples are equal

@shreyamalpani shreyamalpani marked this pull request as ready for review January 14, 2025 15:35
@shreyamalpani shreyamalpani requested review from a team as code owners January 14, 2025 15:35
Tags: args.Tags,
SampleRate: 1,
Timestamp: args.Time,
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for not understanding this better, but what's the reason behind adding this metric? Customers can already technically produce this data on their own using a bit of metric math.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog long review PR is complex, plan time to review it qa/done QA done before merge and regressions are covered by tests team/serverless
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants