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

[WIP][Serverless] add feature to send to s3 bucket #21903

Closed
wants to merge 1 commit into from

Conversation

maxday
Copy link
Contributor

@maxday maxday commented Jan 5, 2024

What does this PR do?

this PR adds a feature to send to a S3 bucket the content of /tmp when a SHUTDOWN event is received
this feature is protected by a build tag and won't be part of the release production build

Motivation

required for various POCs

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the 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.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided. Except if the qa/skip-qa label, with required either qa/done or qa/no-code-change labels, are applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

Copy link

Go Package Import Differences

Baseline: e938af4
Comparison: 09796e5

binaryosarchchange
serverlesslinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/pkg/serverless/tmpdebug
serverlesslinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/pkg/serverless/tmpdebug

Copy link
Contributor

github-actions bot commented Jan 5, 2024

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between 30c3524 and 037e2df.

tl;dr
  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.

Benchmark stats
goos: linux
goarch: amd64
pkg: github.com/DataDog/datadog-agent/pkg/serverless/daemon
cpu: AMD EPYC 7763 64-Core Processor                
                                      │    previous    │                 current                  │
                                      │     sec/op     │     sec/op       vs base                 │
api-gateway-appsec.json                  89.56µ ±   6%   88.18µ ±   2%          ~ (p=0.280 n=10)
api-gateway-kong-appsec.json             67.02µ ±   5%   67.99µ ±   3%          ~ (p=0.190 n=10)
api-gateway-kong.json                    65.70µ ±   3%   67.12µ ±   6%          ~ (p=0.353 n=10)
api-gateway-non-proxy-async.json         102.1µ ±   3%   104.1µ ±   3%     +1.91% (p=0.035 n=10)
api-gateway-non-proxy.json               103.0µ ±   2%   101.1µ ±   2%          ~ (p=0.190 n=10)
api-gateway-websocket-connect.json       70.01µ ±   3%   71.21µ ±   4%          ~ (p=0.579 n=10)
api-gateway-websocket-default.json       62.53µ ±   3%   62.56µ ±   3%          ~ (p=0.739 n=10)
api-gateway-websocket-disconnect.json    62.17µ ±   4%   59.90µ ±   5%          ~ (p=0.123 n=10)
api-gateway.json                         116.6µ ±   4%   110.2µ ±   6%     -5.54% (p=0.011 n=10)
application-load-balancer.json           64.81µ ±  12%   60.54µ ±   4%          ~ (p=0.089 n=10)
cloudfront.json                          52.01µ ±  10%   46.39µ ±   7%    -10.81% (p=0.005 n=10)
cloudwatch-events.json                   39.62µ ±  10%   36.28µ ±   2%     -8.44% (p=0.002 n=10)
cloudwatch-logs.json                     55.19µ ±  15%   52.37µ ±   2%     -5.11% (p=0.001 n=10)
custom.json                              30.36µ ±   6%   29.34µ ±   3%     -3.36% (p=0.015 n=10)
dynamodb.json                           108.28µ ±   8%   97.91µ ±   8%          ~ (p=0.075 n=10)
empty.json                               33.02µ ±  17%   32.37µ ±  15%          ~ (p=0.353 n=10)
eventbridge-custom.json                  47.20µ ±  13%   50.28µ ±  18%          ~ (p=0.105 n=10)
http-api.json                            81.54µ ±  12%   85.93µ ±   9%          ~ (p=0.190 n=10)
kinesis-batch.json                       99.84µ ±   8%   90.82µ ±   6%     -9.03% (p=0.004 n=10)
kinesis.json                             62.74µ ±  19%   68.82µ ± 161%          ~ (p=0.579 n=10)
s3.json                                 111.28µ ± 459%   81.59µ ±    ∞ ¹        ~ (p=0.073 n=8+4)
geomean                                  67.77µ          65.45µ            -3.42%
¹ need >= 6 samples for confidence interval at level 0.95

                                      │   previous    │                 current                 │
                                      │     B/op      │      B/op        vs base                │
api-gateway-appsec.json                 42.07Ki ±  3%   41.81Ki ±  2%         ~ (p=0.353 n=10)
api-gateway-kong-appsec.json            27.95Ki ±  0%   27.94Ki ± 15%         ~ (p=0.753 n=10)
api-gateway-kong.json                   25.29Ki ± 25%   25.29Ki ±  0%         ~ (p=0.107 n=10)
api-gateway-non-proxy-async.json        51.34Ki ±  0%   51.34Ki ±  0%         ~ (p=0.926 n=10)
api-gateway-non-proxy.json              49.90Ki ±  0%   49.89Ki ±  0%         ~ (p=0.288 n=10)
api-gateway-websocket-connect.json      29.11Ki ±  0%   29.11Ki ±  0%         ~ (p=0.616 n=10)
api-gateway-websocket-default.json      23.25Ki ±  0%   23.25Ki ±  0%         ~ (p=0.539 n=10)
api-gateway-websocket-disconnect.json   22.89Ki ±  0%   22.89Ki ±  0%         ~ (p=0.588 n=10)
api-gateway.json                        53.82Ki ±  0%   53.82Ki ±  0%         ~ (p=0.956 n=10)
application-load-balancer.json          22.90Ki ±  0%   22.90Ki ±  0%         ~ (p=0.777 n=10)
cloudfront.json                         18.43Ki ±  0%   18.43Ki ±  0%         ~ (p=0.880 n=10)
cloudwatch-events.json                  11.46Ki ±  0%   11.46Ki ±  0%         ~ (p=0.724 n=10)
cloudwatch-logs.json                    53.28Ki ±  0%   53.28Ki ±  0%         ~ (p=0.851 n=10)
custom.json                             9.215Ki ±  0%   9.214Ki ±  0%         ~ (p=0.169 n=10)
dynamodb.json                           43.24Ki ±  0%   43.24Ki ±  0%         ~ (p=0.751 n=10)
empty.json                              8.708Ki ±  0%   8.707Ki ±  0%         ~ (p=0.253 n=10)
eventbridge-custom.json                 13.18Ki ±  0%   13.18Ki ±  0%         ~ (p=0.446 n=10)
http-api.json                           24.10Ki ±  0%   24.10Ki ±  0%         ~ (p=0.084 n=10)
kinesis-batch.json                      28.40Ki ±  0%   28.40Ki ±  0%         ~ (p=0.643 n=10)
kinesis.json                            18.14Ki ±  0%   18.14Ki ±  0%         ~ (p=0.077 n=10)
s3.json                                 20.86Ki ±  0%   20.86Ki ±   ∞ ¹       ~ (p=0.057 n=8+4)
geomean                                 24.81Ki         24.80Ki          -0.03%
¹ need >= 6 samples for confidence interval at level 0.95

                                      │  previous  │                current                 │
                                      │ allocs/op  │  allocs/op    vs base                  │
api-gateway-appsec.json                 630.0 ± 0%   630.0 ± 0%         ~ (p=1.000 n=10)  ¹
api-gateway-kong-appsec.json            487.0 ± 0%   487.0 ± 0%         ~ (p=1.000 n=10)  ¹
api-gateway-kong.json                   465.0 ± 0%   465.0 ± 0%         ~ (p=1.000 n=10)  ¹
api-gateway-non-proxy-async.json        722.0 ± 0%   722.0 ± 0%         ~ (p=1.000 n=10)
api-gateway-non-proxy.json              712.0 ± 0%   712.0 ± 0%         ~ (p=1.000 n=10)
api-gateway-websocket-connect.json      452.0 ± 0%   452.0 ± 0%         ~ (p=1.000 n=10)  ¹
api-gateway-websocket-default.json      377.0 ± 0%   377.0 ± 0%         ~ (p=1.000 n=10)  ¹
api-gateway-websocket-disconnect.json   367.0 ± 0%   367.0 ± 0%         ~ (p=1.000 n=10)  ¹
api-gateway.json                        786.0 ± 0%   786.0 ± 0%         ~ (p=1.000 n=10)
application-load-balancer.json          348.0 ± 0%   348.0 ± 0%         ~ (p=1.000 n=10)
cloudfront.json                         280.0 ± 0%   280.0 ± 0%         ~ (p=1.000 n=10)  ¹
cloudwatch-events.json                  217.0 ± 0%   217.0 ± 0%         ~ (p=1.000 n=10)  ¹
cloudwatch-logs.json                    211.0 ± 0%   211.0 ± 0%         ~ (p=1.000 n=10)  ¹
custom.json                             165.0 ± 0%   165.0 ± 0%         ~ (p=1.000 n=10)  ¹
dynamodb.json                           584.0 ± 0%   584.0 ± 0%         ~ (p=1.000 n=10)  ¹
empty.json                              156.0 ± 0%   156.0 ± 0%         ~ (p=1.000 n=10)  ¹
eventbridge-custom.json                 249.0 ± 0%   249.0 ± 0%         ~ (p=1.000 n=10)  ¹
http-api.json                           424.0 ± 0%   424.0 ± 0%         ~ (p=1.000 n=10)
kinesis-batch.json                      384.0 ± 0%   384.0 ± 0%         ~ (p=1.000 n=10)  ¹
kinesis.json                            279.0 ± 0%   279.0 ± 0%         ~ (p=1.000 n=10)
s3.json                                 350.0 ± 0%   350.0 ±  ∞ ²       ~ (p=0.473 n=8+4)
geomean                                 372.0        372.0         +0.00%
¹ all samples are equal
² need >= 6 samples for confidence interval at level 0.95

@dd-devflow dd-devflow bot closed this Jul 6, 2024
@dd-devflow dd-devflow bot deleted the maxday/add-serverless-tmp-debug branch July 6, 2024 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants