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

[OTEL-2239] Convert comp/serializer/compression into new style components #30688

Merged
merged 45 commits into from
Nov 26, 2024

Conversation

ankitpatel96
Copy link
Contributor

@ankitpatel96 ankitpatel96 commented Nov 1, 2024

What does this PR do?

This PR modifies comp/serializer/compression into the new "component" style https://datadoghq.dev/datadog-agent/components/overview/. One kind of odd thing it does is creates a selector package - this package contains build time flags to select which implementation to use based on build tags. This is existing logic that I just ported over - I am not trying to change the behavior of anything.

Motivation

We want to split up this package so we can pull in different implementations to avoid cgo dependencies in other packages.

Describe how to test/QA your changes

Unit tests continue to pass

@github-actions github-actions bot added team/agent-metrics-logs long review PR is complex, plan time to review it labels Nov 1, 2024
Copy link

cit-pr-commenter bot commented Nov 11, 2024

Go Package Import Differences

Baseline: 04a7d9a
Comparison: 3001ee4

binaryosarchchange
agentlinuxamd64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
agentlinuxarm64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
agentwindowsamd64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
agentdarwinamd64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
agentdarwinarm64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
iot-agentlinuxamd64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
iot-agentlinuxarm64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
heroku-agentlinuxamd64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
cluster-agentlinuxamd64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
cluster-agentlinuxarm64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
cluster-agent-cloudfoundrylinuxamd64
+4, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
cluster-agent-cloudfoundrylinuxarm64
+4, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
dogstatsdlinuxamd64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
dogstatsdlinuxarm64
+7, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/fx
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
process-agentlinuxamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
process-agentlinuxarm64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
process-agentwindowsamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
process-agentdarwinamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
process-agentdarwinarm64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
heroku-process-agentlinuxamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
security-agentlinuxamd64
+6, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
security-agentlinuxarm64
+6, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
security-agentwindowsamd64
+6, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/common
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zstd
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
serverlesslinuxamd64
+3, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
serverlesslinuxarm64
+3, -3
-github.com/DataDog/datadog-agent/comp/serializer/compression
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl
-github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl/strategy
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
+github.com/DataDog/datadog-agent/comp/serializer/compression/impl-noop
+github.com/DataDog/datadog-agent/comp/serializer/compression/selector
system-probelinuxamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
system-probelinuxarm64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
system-probewindowsamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
trace-agentlinuxamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
trace-agentlinuxarm64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
trace-agentwindowsamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
trace-agentdarwinamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
trace-agentdarwinarm64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def
heroku-trace-agentlinuxamd64
+1, -1
-github.com/DataDog/datadog-agent/comp/serializer/compression
+github.com/DataDog/datadog-agent/comp/serializer/compression/def

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Nov 13, 2024

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

Note: This applies to commit 3001ee4

Copy link

cit-pr-commenter bot commented Nov 13, 2024

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: cea96d7a-b2da-4a01-b5b5-3e58cc5d6882

Baseline: 04a7d9a
Comparison: 3001ee4
Diff

Optimization Goals: ❌ Significant changes detected

perf experiment goal Δ mean % Δ mean % CI trials links
basic_py_check % cpu utilization +8.82 [+4.76, +12.87] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
basic_py_check % cpu utilization +8.82 [+4.76, +12.87] 1 Logs
pycheck_lots_of_tags % cpu utilization +1.80 [-1.66, +5.27] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization +1.02 [+0.29, +1.75] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.85 [+0.06, +1.64] 1 Logs
file_tree memory utilization +0.26 [+0.13, +0.40] 1 Logs
file_to_blackhole_500ms_latency egress throughput +0.18 [-0.58, +0.94] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.01 [-0.10, +0.12] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.00 [-0.71, +0.70] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.00 [-0.64, +0.63] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.01 [-0.78, +0.76] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.01 [-0.48, +0.45] 1 Logs
quality_gate_idle memory utilization -0.17 [-0.22, -0.11] 1 Logs bounds checks dashboard
otel_to_otel_logs ingress throughput -0.58 [-1.28, +0.11] 1 Logs
quality_gate_idle_all_features memory utilization -0.74 [-0.90, -0.59] 1 Logs bounds checks dashboard
tcp_syslog_to_blackhole ingress throughput -1.32 [-1.37, -1.26] 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_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

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, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@GustavoCaso
Copy link
Member

Could we remove the component from the TODO list of components to migrate?

'comp/serializer/compression/compressionimpl',

@ankitpatel96
Copy link
Contributor Author

Could we remove the component from the TODO list of components to migrate?

'comp/serializer/compression/compressionimpl',

Already done!
https://github.com/DataDog/datadog-agent/pull/30688/files#diff-f048224c30106b98e0d1e2937484c4667dab647d7175f85407c2889746fed8e0L146

@StephenWakely
Copy link
Contributor

StephenWakely commented Nov 21, 2024

I agree in principle but frankly I don't know much about the agent and its different distributions. My team doesn't work on this code and I chose to keep the logic the same since I don't know why this piece was included in the first place. Would be easy to tear out in the future

I believe shortly OTel will be looking to incorporate the Native Go zstd implementation to use instead of the cgo one. When that happens I imagine those build tags would be obsolete and we should probably just have something like otel_no_cgo. When set it will choose the native Go zstd package, when unset it will choose the cgo zstd.

Copy link
Contributor

📥 📢 Info, this pull request increases the binary size of serverless extension by -8288 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 0ms.

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.

Copy link
Contributor

@jackgopack4 jackgopack4 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@gabedos gabedos left a comment

Choose a reason for hiding this comment

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

LGTM for container-platform files.

Copy link
Contributor

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between dccac0b and 9c994bb.

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                            83.49µ ± 7%    90.85µ ± 2%  +8.81% (p=0.002 n=10)
api-gateway-kong-appsec.json                       64.55µ ± 1%    69.89µ ± 1%  +8.28% (p=0.000 n=10)
api-gateway-kong.json                              62.24µ ± 2%    67.14µ ± 3%  +7.87% (p=0.000 n=10)
api-gateway-non-proxy-async.json                   99.13µ ± 1%   106.28µ ± 2%  +7.21% (p=0.000 n=10)
api-gateway-non-proxy.json                         97.64µ ± 2%   104.22µ ± 3%  +6.74% (p=0.000 n=10)
api-gateway-websocket-connect.json                 64.98µ ± 1%    69.04µ ± 3%  +6.26% (p=0.000 n=10)
api-gateway-websocket-default.json                 58.74µ ± 2%    58.91µ ± 4%       ~ (p=0.529 n=10)
api-gateway-websocket-disconnect.json              57.69µ ± 1%    57.47µ ± 2%       ~ (p=0.631 n=10)
api-gateway.json                                   106.8µ ± 1%    107.1µ ± 4%       ~ (p=0.481 n=10)
application-load-balancer.json                     56.25µ ± 1%    57.51µ ± 2%  +2.23% (p=0.001 n=10)
cloudfront.json                                    43.19µ ± 1%    43.43µ ± 1%  +0.54% (p=0.035 n=10)
cloudwatch-events.json                             35.09µ ± 1%    36.40µ ± 3%  +3.74% (p=0.000 n=10)
cloudwatch-logs.json                               55.98µ ± 2%    59.53µ ± 1%  +6.34% (p=0.000 n=10)
custom.json                                        28.28µ ± 1%    30.38µ ± 1%  +7.41% (p=0.000 n=10)
dynamodb.json                                      85.52µ ± 3%    85.45µ ± 0%       ~ (p=0.971 n=10)
empty.json                                         27.70µ ± 4%    28.06µ ± 3%       ~ (p=0.190 n=10)
eventbridge-custom.json                            44.02µ ± 2%    45.54µ ± 2%  +3.46% (p=0.001 n=10)
eventbridge-no-bus.json                            43.96µ ± 3%    43.76µ ± 2%       ~ (p=0.955 n=10)
eventbridge-no-timestamp.json                      43.54µ ± 2%    44.10µ ± 2%       ~ (p=0.105 n=10)
eventbridgesns.json                                57.33µ ± 1%    60.30µ ± 1%  +5.18% (p=0.000 n=10)
eventbridgesqs.json                                64.85µ ± 1%    67.39µ ± 2%  +3.92% (p=0.000 n=10)
http-api.json                                      64.69µ ± 2%    68.13µ ± 1%  +5.32% (p=0.000 n=10)
kinesis-batch.json                                 65.56µ ± 1%    67.44µ ± 0%  +2.86% (p=0.002 n=10)
kinesis.json                                       50.07µ ± 1%    52.63µ ± 1%  +5.12% (p=0.000 n=10)
s3.json                                            54.91µ ± 1%    55.92µ ± 2%  +1.84% (p=0.005 n=10)
sns-batch.json                                     83.76µ ± 2%    86.60µ ± 1%  +3.40% (p=0.000 n=10)
sns.json                                           62.70µ ± 2%    64.04µ ± 1%  +2.12% (p=0.009 n=10)
snssqs.json                                        106.4µ ± 3%    111.8µ ± 1%  +5.03% (p=0.000 n=10)
snssqs_no_dd_context.json                          96.18µ ± 1%   100.60µ ± 2%  +4.60% (p=0.000 n=10)
sqs-aws-header.json                                53.57µ ± 2%    55.87µ ± 2%  +4.30% (p=0.000 n=10)
sqs-batch.json                                     85.89µ ± 3%    91.70µ ± 2%  +6.77% (p=0.000 n=10)
sqs.json                                           65.67µ ± 2%    67.98µ ± 2%  +3.52% (p=0.000 n=10)
sqs_no_dd_context.json                             61.05µ ± 3%    63.57µ ± 4%  +4.12% (p=0.005 n=10)
stepfunction.json                                  42.68µ ± 3%    46.01µ ± 4%  +7.80% (p=0.000 n=10)
geomean                                            60.49µ         62.90µ       +4.00%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │          B/op          │     B/op      vs base               │
api-gateway-appsec.json                           37.26Ki ± 0%   37.27Ki ± 0%       ~ (p=0.491 n=10)
api-gateway-kong-appsec.json                      26.90Ki ± 0%   26.91Ki ± 0%  +0.02% (p=0.032 n=10)
api-gateway-kong.json                             24.37Ki ± 0%   24.37Ki ± 0%       ~ (p=0.956 n=10)
api-gateway-non-proxy-async.json                  47.93Ki ± 0%   47.94Ki ± 0%       ~ (p=0.669 n=10)
api-gateway-non-proxy.json                        47.11Ki ± 0%   47.11Ki ± 0%       ~ (p=0.808 n=10)
api-gateway-websocket-connect.json                25.34Ki ± 0%   25.34Ki ± 0%  +0.01% (p=0.044 n=10)
api-gateway-websocket-default.json                21.23Ki ± 0%   21.23Ki ± 0%       ~ (p=0.320 n=10)
api-gateway-websocket-disconnect.json             20.99Ki ± 0%   20.99Ki ± 0%       ~ (p=0.124 n=10)
api-gateway.json                                  49.26Ki ± 0%   49.26Ki ± 0%       ~ (p=0.322 n=10)
application-load-balancer.json                    22.12Ki ± 0%   22.12Ki ± 0%       ~ (p=1.000 n=10)
cloudfront.json                                   17.43Ki ± 0%   17.43Ki ± 0%       ~ (p=0.677 n=10)
cloudwatch-events.json                            11.49Ki ± 0%   11.49Ki ± 0%       ~ (p=0.809 n=10)
cloudwatch-logs.json                              53.04Ki ± 0%   53.05Ki ± 0%  +0.01% (p=0.001 n=10)
custom.json                                       9.527Ki ± 0%   9.527Ki ± 0%       ~ (p=0.211 n=10)
dynamodb.json                                     40.30Ki ± 0%   40.30Ki ± 0%       ~ (p=0.305 n=10)
empty.json                                        9.065Ki ± 0%   9.065Ki ± 0%       ~ (p=1.000 n=10)
eventbridge-custom.json                           14.67Ki ± 0%   14.67Ki ± 0%       ~ (p=0.969 n=10)
eventbridge-no-bus.json                           13.63Ki ± 0%   13.63Ki ± 0%       ~ (p=0.665 n=10)
eventbridge-no-timestamp.json                     13.63Ki ± 0%   13.63Ki ± 0%  +0.01% (p=0.049 n=10)
eventbridgesns.json                               20.43Ki ± 0%   20.43Ki ± 0%       ~ (p=0.621 n=10)
eventbridgesqs.json                               24.56Ki ± 0%   24.56Ki ± 0%       ~ (p=0.940 n=10)
http-api.json                                     23.25Ki ± 0%   23.25Ki ± 0%       ~ (p=0.484 n=10)
kinesis-batch.json                                26.49Ki ± 0%   26.50Ki ± 0%       ~ (p=0.253 n=10)
kinesis.json                                      17.37Ki ± 0%   17.37Ki ± 0%       ~ (p=0.148 n=10)
s3.json                                           19.87Ki ± 0%   19.87Ki ± 0%       ~ (p=0.176 n=10)
sns-batch.json                                    39.07Ki ± 0%   39.07Ki ± 0%       ~ (p=0.212 n=10)
sns.json                                          24.49Ki ± 0%   24.49Ki ± 0%       ~ (p=0.668 n=10)
snssqs.json                                       52.68Ki ± 0%   52.68Ki ± 0%       ~ (p=0.477 n=10)
snssqs_no_dd_context.json                         46.44Ki ± 0%   46.44Ki ± 0%       ~ (p=0.058 n=10)
sqs-aws-header.json                               18.78Ki ± 0%   18.77Ki ± 0%       ~ (p=0.342 n=10)
sqs-batch.json                                    41.26Ki ± 0%   41.26Ki ± 0%       ~ (p=0.247 n=10)
sqs.json                                          25.39Ki ± 0%   25.39Ki ± 0%       ~ (p=0.061 n=10)
sqs_no_dd_context.json                            21.01Ki ± 0%   21.01Ki ± 0%       ~ (p=0.554 n=10)
stepfunction.json                                 13.51Ki ± 0%   13.51Ki ± 0%       ~ (p=0.178 n=10)
geomean                                           24.08Ki        24.09Ki       +0.00%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │       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                        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                    723.0 ± 0%   723.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-non-proxy.json                          713.0 ± 0%   713.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-connect.json                  451.0 ± 0%   451.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-websocket-default.json                  376.0 ± 0%   376.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-disconnect.json               366.0 ± 0%   366.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway.json                                    785.0 ± 0%   785.0 ± 0%       ~ (p=1.000 n=10) ¹
application-load-balancer.json                      348.0 ± 0%   348.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudfront.json                                     281.0 ± 0%   281.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudwatch-events.json                              218.0 ± 0%   218.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudwatch-logs.json                                211.0 ± 0%   211.0 ± 0%       ~ (p=1.000 n=10) ¹
custom.json                                         166.0 ± 0%   166.0 ± 0%       ~ (p=1.000 n=10) ¹
dynamodb.json                                       582.0 ± 0%   582.0 ± 0%       ~ (p=1.000 n=10) ¹
empty.json                                          157.0 ± 0%   157.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridge-custom.json                             261.0 ± 0%   261.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridge-no-bus.json                             252.0 ± 0%   252.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridge-no-timestamp.json                       252.0 ± 0%   252.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridgesns.json                                 318.0 ± 0%   318.0 ± 0%       ~ (p=1.000 n=10) ¹
eventbridgesqs.json                                 358.0 ± 0%   358.0 ± 0%       ~ (p=1.000 n=10) ¹
http-api.json                                       424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=10) ¹
kinesis-batch.json                                  383.0 ± 0%   383.0 ± 0%       ~ (p=1.000 n=10) ¹
kinesis.json                                        279.0 ± 0%   279.0 ± 0%       ~ (p=1.000 n=10) ¹
s3.json                                             351.0 ± 0%   351.0 ± 0%       ~ (p=1.000 n=10) ¹
sns-batch.json                                      465.0 ± 0%   465.0 ± 0%       ~ (p=1.000 n=10) ¹
sns.json                                            336.0 ± 0%   336.0 ± 0%       ~ (p=1.000 n=10) ¹
snssqs.json                                         460.0 ± 0%   460.0 ± 0%       ~ (p=1.000 n=10) ¹
snssqs_no_dd_context.json                           420.0 ± 0%   420.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs-aws-header.json                                 276.0 ± 0%   276.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs-batch.json                                      500.0 ± 0%   500.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs.json                                            351.0 ± 0%   351.0 ± 0%       ~ (p=1.000 n=10) ¹
sqs_no_dd_context.json                              337.0 ± 0%   337.0 ± 0%       ~ (p=1.000 n=10) ¹
stepfunction.json                                   226.0 ± 0%   226.0 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                             360.0        360.0       +0.00%
¹ all samples are equal

Copy link
Contributor

@StephenWakely StephenWakely left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@DDuongNguyen DDuongNguyen left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@ankitpatel96
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Nov 26, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-11-26 21:21:05 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 23m.

@dd-mergequeue dd-mergequeue bot merged commit 4ee1010 into main Nov 26, 2024
226 checks passed
@dd-mergequeue dd-mergequeue bot deleted the OTEL-1935-split-compression branch November 26, 2024 21:44
@github-actions github-actions bot added this to the 7.61.0 milestone Nov 26, 2024
@ankitpatel96 ankitpatel96 added the qa/done QA done before merge and regressions are covered by tests label Dec 3, 2024
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/agent-metrics-logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.