datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

workload policy from multiple activity dumps

Open mftoure opened this issue 1 year ago • 4 comments

What does this PR do?

Motivation

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

mftoure avatar Aug 08 '24 16:08 mftoure

Regression Detector

Regression Detector Results

Run ID: f89b0169-ef36-4d9e-b2c4-c14c5e4237bd Metrics dashboard Target profiles

Baseline: 06338e9bfc7594ed45344e69ff29a01945bacded Comparison: a963b2c3f93e8ab473c7fc91ad0f450f9f994f77

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.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
pycheck_lots_of_tags % cpu utilization +1.39 [-1.15, +3.93] 1 Logs
otel_to_otel_logs ingress throughput +1.17 [+0.36, +1.98] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.38 [+0.33, +0.44] 1 Logs
idle memory utilization +0.27 [+0.22, +0.32] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.11 [-0.64, +0.86] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.09, +0.08] 1 Logs
basic_py_check % cpu utilization -0.12 [-2.87, +2.63] 1 Logs
file_tree memory utilization -0.91 [-1.02, -0.80] 1 Logs

Bounds Checks

perf experiment bounds_check_name replicates_passed
idle memory_usage 10/10

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:

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

pr-commenter[bot] avatar Aug 08 '24 17:08 pr-commenter[bot]

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=44896611 --os-family=ubuntu

Note: This applies to commit a963b2c3

pr-commenter[bot] avatar Sep 17 '24 13:09 pr-commenter[bot]

:warning::rotating_light: Warning, this pull request increases the binary size of serverless extension by 332704 bytes. Each MB of binary size increase means about 10ms of additional cold start time, so this pull request would increase cold start time by 3ms.

Debug info

If you have questions, we are happy to help, come visit us in the #serverless slack channel and provide a link to this comment.

We suggest you consider adding the !serverless build tag to remove any new dependencies not needed in the serverless extension.

github-actions[bot] avatar Sep 23 '24 08:09 github-actions[bot]

:warning::rotating_light: Warning, this pull request increases the binary size of serverless extension by 332704 bytes. Each MB of binary size increase means about 10ms of additional cold start time, so this pull request would increase cold start time by 3ms.

Debug info

If you have questions, we are happy to help, come visit us in the #serverless slack channel and provide a link to this comment.

We suggest you consider adding the !serverless build tag to remove any new dependencies not needed in the serverless extension.

github-actions[bot] avatar Sep 23 '24 10:09 github-actions[bot]

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between ea7ff2e8d9578d95525d192859074185ac94932e and fb5c79106fb6310346af0dc7ccff8f27c537014c.

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                            92.31µ ± 6%   87.22µ ± 6%  -5.51% (p=0.035 n=10)
api-gateway-kong-appsec.json                       69.62µ ± 2%   68.50µ ± 2%       ~ (p=0.190 n=10)
api-gateway-kong.json                              67.92µ ± 1%   66.41µ ± 1%  -2.24% (p=0.002 n=10)
api-gateway-non-proxy-async.json                   108.7µ ± 2%   105.9µ ± 1%  -2.53% (p=0.001 n=10)
api-gateway-non-proxy.json                         109.4µ ± 2%   106.8µ ± 2%  -2.36% (p=0.000 n=10)
api-gateway-websocket-connect.json                 73.42µ ± 1%   70.95µ ± 1%  -3.36% (p=0.000 n=10)
api-gateway-websocket-default.json                 66.24µ ± 1%   63.89µ ± 1%  -3.55% (p=0.000 n=10)
api-gateway-websocket-disconnect.json              66.27µ ± 1%   64.02µ ± 1%  -3.40% (p=0.000 n=10)
api-gateway.json                                   121.1µ ± 2%   116.3µ ± 1%  -3.97% (p=0.001 n=10)
application-load-balancer.json                     67.44µ ± 1%   65.04µ ± 1%  -3.56% (p=0.000 n=10)
cloudfront.json                                    50.34µ ± 1%   48.40µ ± 2%  -3.85% (p=0.000 n=10)
cloudwatch-events.json                             40.46µ ± 1%   39.77µ ± 1%  -1.70% (p=0.007 n=10)
cloudwatch-logs.json                               67.87µ ± 2%   66.59µ ± 2%  -1.89% (p=0.035 n=10)
custom.json                                        32.87µ ± 2%   32.61µ ± 2%       ~ (p=0.315 n=10)
dynamodb.json                                      98.25µ ± 2%   95.56µ ± 1%  -2.74% (p=0.000 n=10)
empty.json                                         31.11µ ± 2%   31.30µ ± 1%       ~ (p=0.225 n=10)
eventbridge-custom.json                            44.41µ ± 2%   43.78µ ± 1%       ~ (p=0.105 n=10)
http-api.json                                      76.33µ ± 1%   74.61µ ± 1%  -2.26% (p=0.000 n=10)
kinesis-batch.json                                 74.35µ ± 2%   72.59µ ± 2%  -2.37% (p=0.002 n=10)
kinesis.json                                       56.50µ ± 3%   55.87µ ± 2%       ~ (p=0.353 n=10)
s3.json                                            62.43µ ± 2%   61.69µ ± 1%  -1.19% (p=0.029 n=10)
sns-batch.json                                     94.38µ ± 1%   92.39µ ± 1%  -2.11% (p=0.002 n=10)
sns.json                                           66.92µ ± 1%   66.82µ ± 1%       ~ (p=0.912 n=10)
snssqs.json                                        115.8µ ± 1%   112.1µ ± 1%  -3.17% (p=0.000 n=10)
snssqs_no_dd_context.json                          102.8µ ± 2%   100.9µ ± 2%       ~ (p=0.063 n=10)
sqs-aws-header.json                                58.18µ ± 2%   56.78µ ± 2%  -2.41% (p=0.000 n=10)
sqs-batch.json                                     97.85µ ± 2%   96.52µ ± 1%  -1.35% (p=0.011 n=10)
sqs.json                                           72.35µ ± 2%   70.50µ ± 2%  -2.56% (p=0.011 n=10)
sqs_no_dd_context.json                             64.52µ ± 1%   62.89µ ± 1%  -2.52% (p=0.001 n=10)
stepfunction.json                                                47.57µ ± 1%
geomean                                            70.11µ        67.66µ       -2.32%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │          B/op          │     B/op      vs base               │
api-gateway-appsec.json                           37.32Ki ± 0%   37.27Ki ± 0%  -0.13% (p=0.000 n=10)
api-gateway-kong-appsec.json                      26.92Ki ± 0%   26.93Ki ± 0%  +0.05% (p=0.022 n=10)
api-gateway-kong.json                             24.42Ki ± 0%   24.43Ki ± 0%  +0.05% (p=0.012 n=10)
api-gateway-non-proxy-async.json                  48.10Ki ± 0%   48.08Ki ± 0%       ~ (p=0.075 n=10)
api-gateway-non-proxy.json                        47.32Ki ± 0%   47.30Ki ± 0%  -0.06% (p=0.003 n=10)
api-gateway-websocket-connect.json                25.50Ki ± 0%   25.51Ki ± 0%       ~ (p=0.183 n=10)
api-gateway-websocket-default.json                21.41Ki ± 0%   21.41Ki ± 0%       ~ (p=0.322 n=10)
api-gateway-websocket-disconnect.json             21.19Ki ± 0%   21.20Ki ± 0%       ~ (p=0.516 n=10)
api-gateway.json                                  49.58Ki ± 0%   49.60Ki ± 0%  +0.05% (p=0.006 n=10)
application-load-balancer.json                    23.29Ki ± 0%   22.38Ki ± 0%  -3.89% (p=0.000 n=10)
cloudfront.json                                   17.67Ki ± 0%   17.67Ki ± 0%       ~ (p=0.868 n=10)
cloudwatch-events.json                            11.73Ki ± 0%   11.72Ki ± 0%  -0.07% (p=0.041 n=10)
cloudwatch-logs.json                              53.37Ki ± 0%   53.40Ki ± 0%  +0.05% (p=0.000 n=10)
custom.json                                       9.758Ki ± 0%   9.758Ki ± 0%       ~ (p=0.956 n=10)
dynamodb.json                                     40.82Ki ± 0%   40.79Ki ± 0%  -0.06% (p=0.043 n=10)
empty.json                                        9.318Ki ± 0%   9.328Ki ± 0%       ~ (p=0.218 n=10)
eventbridge-custom.json                           13.47Ki ± 0%   13.45Ki ± 0%       ~ (p=0.171 n=10)
http-api.json                                     23.81Ki ± 0%   23.78Ki ± 0%  -0.14% (p=0.011 n=10)
kinesis-batch.json                                27.07Ki ± 0%   27.04Ki ± 0%       ~ (p=0.184 n=10)
kinesis.json                                      17.84Ki ± 0%   17.85Ki ± 0%       ~ (p=0.754 n=10)
s3.json                                           20.38Ki ± 0%   20.38Ki ± 0%       ~ (p=0.796 n=10)
sns-batch.json                                    38.72Ki ± 0%   38.74Ki ± 0%       ~ (p=0.101 n=10)
sns.json                                          24.02Ki ± 0%   24.08Ki ± 0%  +0.27% (p=0.001 n=10)
snssqs.json                                       50.81Ki ± 0%   50.62Ki ± 0%  -0.38% (p=0.000 n=10)
snssqs_no_dd_context.json                         44.90Ki ± 0%   44.87Ki ± 0%  -0.05% (p=0.017 n=10)
sqs-aws-header.json                               18.93Ki ± 1%   18.88Ki ± 0%       ~ (p=0.190 n=10)
sqs-batch.json                                    41.69Ki ± 0%   41.72Ki ± 0%       ~ (p=0.424 n=10)
sqs.json                                          25.63Ki ± 1%   25.71Ki ± 0%  +0.32% (p=0.043 n=10)
sqs_no_dd_context.json                            20.74Ki ± 1%   20.71Ki ± 0%       ~ (p=1.000 n=10)
stepfunction.json                                                14.18Ki ± 1%
geomean                                           25.80Ki        25.25Ki       -0.15%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │       allocs/op        │ allocs/op   vs base                 │
api-gateway-appsec.json                             629.0 ± 0%   629.5 ± 0%       ~ (p=1.000 n=10)
api-gateway-kong-appsec.json                        488.0 ± 0%   488.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-kong.json                               466.0 ± 0%   466.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-non-proxy-async.json                    726.0 ± 0%   726.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-non-proxy.json                          716.0 ± 0%   716.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-websocket-connect.json                  453.0 ± 0%   453.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-websocket-default.json                  379.0 ± 0%   379.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-websocket-disconnect.json               370.0 ± 0%   370.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway.json                                    791.0 ± 0%   791.0 ± 0%       ~ (p=1.000 n=10)
application-load-balancer.json                      353.0 ± 0%   352.0 ± 0%  -0.28% (p=0.000 n=10)
cloudfront.json                                     284.0 ± 0%   284.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudwatch-events.json                              220.0 ± 0%   220.5 ± 0%       ~ (p=0.650 n=10)
cloudwatch-logs.json                                216.0 ± 0%   216.0 ± 0%       ~ (p=0.628 n=10)
custom.json                                         169.0 ± 1%   169.0 ± 1%       ~ (p=1.000 n=10)
dynamodb.json                                       589.0 ± 0%   589.0 ± 0%       ~ (p=1.000 n=10)
empty.json                                          160.0 ± 0%   160.0 ± 0%       ~ (p=1.000 n=10)
eventbridge-custom.json                             254.0 ± 0%   254.0 ± 0%       ~ (p=0.474 n=10)
http-api.json                                       433.0 ± 0%   433.0 ± 0%       ~ (p=0.675 n=10)
kinesis-batch.json                                  391.0 ± 0%   391.0 ± 0%       ~ (p=0.861 n=10)
kinesis.json                                        285.0 ± 0%   286.0 ± 0%       ~ (p=0.156 n=10)
s3.json                                             358.0 ± 0%   358.0 ± 0%       ~ (p=0.854 n=10)
sns-batch.json                                      455.5 ± 0%   455.0 ± 0%       ~ (p=0.999 n=10)
sns.json                                            324.0 ± 0%   324.0 ± 0%       ~ (p=0.303 n=10)
snssqs.json                                         450.0 ± 0%   438.5 ± 0%  -2.56% (p=0.000 n=10)
snssqs_no_dd_context.json                           400.0 ± 0%   400.0 ± 0%       ~ (p=1.000 n=10)
sqs-aws-header.json                                 275.5 ± 1%   274.0 ± 0%       ~ (p=0.078 n=10)
sqs-batch.json                                      504.0 ± 0%   504.0 ± 0%       ~ (p=0.827 n=10)
sqs.json                                            352.0 ± 1%   353.0 ± 1%       ~ (p=0.261 n=10)
sqs_no_dd_context.json                              325.0 ± 1%   325.0 ± 0%       ~ (p=0.495 n=10)
stepfunction.json                                                236.0 ± 1%
geomean                                             377.2        371.0       -0.09%
¹ all samples are equal

github-actions[bot] avatar Sep 23 '24 10:09 github-actions[bot]